Avoid any content duplication and ensure Google opts for a particular version of your site when indexing – fix up your redirects to choose either http://yourdomain.com or http://www.yourdomain.com by putting in a 301 redirect.
There is a possibility that failing to this may create duplicate content and be penalised by the Googler
You can get plugins for Drupal 7 to do this but earlier versions have limited modules, “nodewords” was being used for Drupal 6 but is now abandoned so best off to fix in the .htaccess file.
To force the use of http://www.yourdomain.com on your website instead of http://yourdomain.com you need to edit the .htaccess file in the web root directory.
The rules already exist – they just need to be uncommented out in the .htaccess file of the default Drupal install, have your domain applied to the example below.
Or just use:
RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Or edit the original component of the htaccess where appropiate, as shipped with Drupal 6
RewriteEngine on # If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/...) # uncomment and adapt the following: # RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
You can also use Global Redirect and Meta Tags modules in Drupal 7 which sort out the canonical links via plugins.