Mobile app version of vmapp.org
Login or Join
Goswami781

: 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

@Goswami781

Posted in: #Iis #Redirects #UrlRewriting

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>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme