It has long been considered good practice to choose if you wish your site to be promoted with the www prefix or without. These days it is perfectly acceptable to choose either method but it is important that you make this choice. Not doing so can result in loss of Pagerank™, hijacking and now a duplicate content penalty from Google.
The reasoning behind this choice was first based on the risk to Google Pagerank™ for your website. No one wanted to any chance of link popularity being divided between the www and non-www version. It was far simpler to control the way other sites linked to you locally through .htaccess than to contact them to alter their page code.
Then Google Hijacking came onto the scene and determining your prefix through .htaccess became a sensible method to protect your site.
Now choosing your site prefix has become even more important. It seems that inbound links to www and non-www versions of your site can result in both versions being queued up for inclusion within Google's results. This has only now become a problem because Google has introduced a filter in their algorithm to automatically pick out duplicate copies of web content at the inclusion stage and discard or penalise one of them. Usually the site with the strongest link popularity will be chosen to be the origional version.
We have been seeing this here at e3internet, with a dozen cases in the last six months. This seems to have hit older, well indexed sites particularly hard, leaving them wondering exactly what they did to upset Google! The result of being hit with the duplicate filter is of course a loss of positioning in the index for your keyword phrases. This may be represented by a loss of visible PageRank™ on the Google toolbar but this tool is updated rarely. The best solution seemed to be resolving the problem using .htaccess and a fast re-index. Our findings have now been confirmed in a recent Threadwatch discussion on using canonical domains to sabotage competitors in Google.
What can I do?
You need to write a special text file called .htaccess (note the period before the filename) and place this into the root directory (top) of your web space. Or of course add the following rule to an existing .htaccess file there:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^your-url.com [NC]
RewriteRule ^(.*)$ http://www.your-url.com/$1 [L,R=301]
Replace your-url.com with your own website URL.
Of course you may prefer to promote the non-www address of your site, in which case you should use the following code to redirect all traffic for www to your non-www version.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^your-url.com [NC]
RewriteRule ^(.*)$ http://your-url.com/$1 [L,R=301]
The important thing is that you select which version of your website you wish to promote and secure yourself against this happening.
Update 16/06/05
I have just been asked how you can impliment this fix on a Windows server. Well if you are running Apache then you can simply activate mod_rewrite in your httpd.conf file and use as normal. Read this thread at WWW and this one at Ozone Asylum for more help. If you are running IIS then you should have a look at this tool. This will allow you to write mod_rewrite commands such as the ones above and their lite version is free to download.
Update: 13/09/05
Matt Cutts of Google has confirmed this issue now, so well worth a read over at his blog.
