Forum Moderators: open

Message Too Old, No Replies

ISAPI Rewrite Tips

301 Redirect example.com to www.example.com

         

pageoneresults

6:42 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For those of you utilizing an ISAPI filter for URI rewriting, here is a quick tip on setting up a 301 Moved Permanently rule for example.com to www.example.com.

RewriteCond Host: ^example\.com 
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]

Just drop the above rule into your .ini file and you are good to go. No longer do you need to get your hosting provider involved when setting up 301 Moved Permanently redirects.

Be sure to always check your Server Headers [searchengineworld.com] to make sure that the correct HTTP Status Codes are being returned.

[edited by: Xoc at 5:14 am (utc) on April 27, 2004]
[edit reason] Fixed example [/edit]

pageoneresults

7:36 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Here is an example of redirecting an old-page.asp to a new-page.asp...

RewriteRule /old-page.asp http://www.example.com/new-page.asp [I,O,RP]

Just drop the above code in your local .ini file.