avoid duplicate content

in the last weeks i started to read a lot of seo stuff.
one main thing i learned was to avoid duplicate content.
normally if you have a domain registered at an isp, your website is reachable under www.domain.tld and domain.tld. for google, msn, yahoo and so on, this means there are two sites with the same content. that could affect that your website is getting a bad rank in the searchengine. there is an easy way the remove that.

edit your .htaccess and add the following:

RewriteCond %{HTTP_HOST} !^www\.yourdomain\.tld$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.tld/$1 [R=301,L]

in some cases you’ll have to add this on the top:

RewriteEngine On

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.