
Originally Posted by
Loko
How come I can access my site with and without 'www'.
You just need to set a 301 redirect via .htaccess to your preferred domain, either 'www' or 'without www', that way all requests are sent to the only one you want available.
redirect all to 'www'
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
redirect all to non 'www'
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
Bookmarks