What’s canonicalization?
In Matt Cutt’s words, Canonicalization is…
Canonicalization is the process of picking the best url when there are several choices, and it usually refers to home pages.
For instance, a human will consider these are the same URLs for a website: www.dummywebsite.com, dummywebsite.com, and dummywebsite.com/index.html. Technically, or in search engine’s eyes, there URLs are all different. A web server could return different content for each URL thus these URLs are all indexed separately in Google’s database. Such situation had caused problems to webmasters as Google impose penalty for duplicated content and having the same content showed up on www.dummywebsite.com, dummywebsite.com, and dummywebsite.com/index.html will certainly trigger the ban.
This was a pretty huge issue in the past and it sparks lots of debates and arguments. Websites with both WWW (www.dummywebsite.com) and non-WWW (dummywebsite.com) version get penalized by Google.
Nowadays, the issue can be solved easily with the usage of Google Webmaster Tools (you get to select which version of the website is preferred) or with the usage of rel=”canonical” tags. There are pretty much info covered at Google official guidelines: What is a canonical page? Why specify a canonical page? and I’m not going to drill deep on that.
Avoid canonical issue from your .htaccess file
What I want to discuss here is things to be done at your end to avoid such problem.
The non-WWW and WWW pages can be a huge treat to your website ranking and shouldn’t be taken lightly. Besides stating which version (WWW or non-WWW) to be indexed at Google, you can actually standardized your website URL with a few lines of .htaccess code.
301 Redirect at Bluehost
One good part about Bluehost is that the hosting company allows modification of .htaccess file (a server configuration file located at root folder by default). This makes our life easier when it comes to avoiding Google duplication (or canonical) penalty.
What you can do at your end to avoid this hassle is to 301 redirect your non-WWW web pages to WWW counterparts.
One good thing about hosting with Bluehost is that Bluehost users are allowed to access (create/modify/delete) the .htaccess files at root. Hence, redirecting all non-www web pages to www counterpart is easy.
To do so, simply add the following lines to your ,htaccess file (replace fakesite.com with your website URL):
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.fakesite\.com [NC]
RewriteRule ^(.*) http://www.fakesite.com/$1 [L,R=301]
The codes above will direct all your non-WWW URL to the WWW version thus it will not cause any duplication issue for your website. To test, simply type in the non-www URL of your website to your Internet browser and see your web URL being redirect to the www.