: What HTTP header code does URL-Rewrite return? If I used the native URL-Rewrite module to rewrite (not redirect) a URL, does it return 302, 301, or 200? Is this method OK to use for a permanent
If I used the native URL-Rewrite module to rewrite (not redirect) a URL, does it return 302, 301, or 200? Is this method OK to use for a permanent URL rewrite?
Here is sample code for the redirect:
<rewrite>
<rules>
<rule name="Rewriter" patternSyntax="ExactMatch" stopProcessing="true">
<match url="foobar" />
<action type="Rewrite" url="/actual/foobar.aspx" />
</rule>
</rules>
</rewrite>
More posts by @Goswami781
1 Comments
Sorted by latest first Latest Oldest Best
Since the rule is only rewriting the URL, it should return a standard '200' HTTP header code (assuming there are no other errors). If you had used a redirect action type instead of rewrite, then you would have received a 301 or 302 HTTP response code depending on how the rule was configured. There are a variety of tools available that you can install on your local client to view the HTTP response codes that are being returned to the browser. A very popular one is Fiddler which provides a lot of monitoring details. These types of tools can be very useful when debugging rewrite and redirect rules.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.