Blogging Tip No. 6: use a canonical domain name!
In basic english, what this tip means is either use www.yourdomain.com or yourdomain.com as your definitive domain name (“canonical” is a fancy word for “definitive”).
To do this, log into Google webmaster tools and set it to either of yourdomain.com or www.yourdomain.com – so that Google knows the preferred way of writing your address.
Here’s some information from the Webmaster Help Center on how to go about this.
The other thing you should do is create a 301 http redirect in .htaccess from the non-www version to the www version (or vice versa depending on your preference); e.g. try clicking www.websitedoctor.com or websitedoctor.com.
Here’s the word of Google search engineer, Matt Cutts, on the topic of canonicalisation:
Canonicalization is the process of picking the best url when there are several choices, and it usually refers to home pages. For example, most people would consider these the same urls:
But technically all of these urls are different. A web server could return completely different content for all the urls above. When Google canonicalizes a url, we try to pick the url that seems like the best representative from that set.
Q: So how do I make sure that Google picks the url that I want?
A: One thing that helps is to pick the url that you want and use that url consistently across your entire site. For example, dont make half of your links go to http://example.com/ and the other half go to http://www.example.com/ . Instead, pick the url you prefer and always use that format for your internal links.