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:
www.example.com
example.com/
www.example.com/index.html
example.com/home.asp
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.
It does not matter if you pick proper URL canonicalization pointing to the www’s or non-www’s, but you need to pick one and stick to it. I personally always choose the www’s because more people (from my experience) tend to link to you with the full URL.
Why canonicalize?
Its all about SEO. As you know linking is most important SEO activity. If two sites are linking you, one at wisacc.com and one at www.wisacc.com, Google will consider then two seprate pages, and your home page will not reap the benefit of two links. So be sure that any variation of the homepage URL needs to be redirected to one URL, whichever you choose.
Any extension of your URL like:
• http://www.example.com/index.php
• http://www.example.com/index.htm
• http://www.example.com/default.html
• http://www.example.com/default.php
• http://www.example.com/anything (that goes to homepage)
All need to be pointed to the main – http://www.example.com (without any extensions). You also need to make sure that you don’t have any dev links that need to be 301-ed to their new addresses so you don’t have any bad or dead links on the site.
How to canonicalize?
You can handle all these changes via the .htaccess file. Here is a little code that can help you:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
(Make sure your Apache installation has mod_rewrite enabled.)
As long as your Apache installation has mod_rewrite enabled then you should be able to use this fix on almost any host.
Note: use these two lines to redirect all variations of home page seprately.
Wordpress blogs canonicalize your url automatically. That is why I use WP for all my projects.