Prevent duplication of content using .htaccess
Friday, August 8, 2008 1:20Most domain names are accessible by http://domain.com and http://www.domain.com. Most webmasters don’t know that www. is actually a subdomain and can result in being punished by search engines because they see it as duplicate content.
To prevent this from happening, just copy paste the following code into your .htaccess file. In case your htaccess file already contains the RewriteEngine On entry, you do not have to add it again. However make sure to paste the code BELOW the RewriteEngine On entry. ( replace yourdomain.com with your site’s domain name. )
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Hope it helped!


(4.5 out of 5)
(4 out of 5)
iTechnoBuzz! says:
September 29th, 2008 at 9:18 pm
Thanx for the tut mate.. I used it and it worked perfectly..
Chetan(XC) says:
December 14th, 2008 at 12:44 am
WOW !! Thanx For This .. i was in need of this