How to redirect all traffic to non-www version of your website

Goto the document root of your website
Edit the .htaccess file located there.
Add the following code to the file

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*) http://example.com/$1 [R=301,L]

Save and exit the file
Restart the web server


Article Details

Last Updated
4th of March, 2010

Related Articles

No related articles were found.

Attachments

No attachments were found.


User Opinions



How would you rate this answer?




Thank you for rating this answer.

© Copyright 2009 FireHost Inc. Privacy Policy Legal Information