Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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>
share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.