Redirect traffic from the address www on the address non www
Author: Vitaly Semenov
Visited 1028,
Followers 1,
Shared 0
Hello.
I have added your site to Google webmaster.com. He is there in the two kinds of addresses www.vitsem.com and vitsem.com. Tell me how can I check that they do not work as the two sites. I want all traffic going to vitsem.com. How do I do this? And how can I check that it is need?
Thank you very much.
Posted on the
Hello Vitaly,
Put the following code inside your .htaccess file in the root folder of your X5 project on your web server:
#Redirect www to non-www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.vitsem.com [NC]
RewriteRule ^(.*)$ http://vitsem.com/$1 [L,R=301]
This will ensure that each and every page which a visitor requests is directed to the non-www version.
The redirect as above is permanent, and as such should not affect your search engine ranking.
Kind regards,
Paul