Skip to main content
Tweeted twitter.com/#!/StackWebmasters/status/487515475543592960
remove "thanks", adust tags
Source Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

If I used the native URL-Rewrite module to rewrite (not redirect) a URL, does it return 302, 301, or 200? Is this method okOK to use for a permanent URL rewrite?

Thanks,

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>

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?

Thanks,

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>

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>
Source Link

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 URL rewrite?

Thanks,

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>