pageoneresults
06-04-2004, 12:04 PM
Redirect Sub-Domain to Domain
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 http://example.com/ to http://www.example.com/.
RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]
Just drop the above rule into your httpd.ini file. 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 to make sure that the correct HTTP Status Codes are being returned.
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 http://example.com/ to http://www.example.com/.
RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]
Just drop the above rule into your httpd.ini file. 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 to make sure that the correct HTTP Status Codes are being returned.