Search engines see www and non-www website structure of the same domain as different website addresses, this can be seen as duplicate content because of the same content served on both addresses.
So which is best www or non-www. Personally I use the www version as it’s generally a human accepted structure for URLs.
To achieve this consistent www version the .htaccess requires editing unless you are using WordPress in which case this can be set via ‘WordPress Address (URL)’ in settings/general.
The .htaccess redirection to add www:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
And for those who prefer to remove the www.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
Leave a Reply
Want to join the discussion?Feel free to contribute!