How to fix indexing www and non-www versions of domain
Saturday, August 12, 2006
Google may index both versions of your domain (eg: http://www.yourdomain.com and http://yourdomain.com)
This is because of links to your website (both internal and external) using www and non-www version of URL. In this case, if you have twenty site's linking to you in different versions of your URL, you may not get the full benefit of those twenty links because the rank value may be divided between these two versions.
Best solution to fix this is and safest way to preserve your rank is setting up 301 redirection from bad version to the original version. Apache server can do this by placing the following code in .htaccess file.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com$
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent]
Remember you don't submit remove url form on google to remove the bad version of your URLs.