Post by Malcolm Slade on Tuesday, February 19th, 2008 in Search Engine Marketing, Search Engine Optimisation
One technical issue that we identify at the start of most SEO projects is Canonicalisation (Canonicalization for the USA). For those who don’t already know, Canonicalisation is basically having your site rendering as http://www.mypoorlysite.com and http://mypoorlysite.com.
Ideally a site should only render under a single domain to avoid any problems with duplicate content. Although Google claims this is no longer an issue, evidence shows otherwise with pages from many domains being indexed with the www and without. For some this causes no real problems, for others it can cause a complete nightmare with duplicate content causing major pages to disappear and rankings vanishing over night.
In either case with the fix being relatively simple (especially if you own the server / have admin access / use a competant web host) there is no excuse.
So to cover this topic I will define two hypothetical problems and document how to solve them.
Situation 1
I have a site running on IIS 6 that suffers from canonicalisation.
Problem 1
My site renders as http://www.mysite.com and http://mysite.com. I want it to only render with the www extension and handle anyone using the non-www properly rather than showing them a 404 page.
Solution 1
Open IIS Manager and create a new site profile for the non-www version of the site. The IP address and port should be the same, as should the home directory. Set the host header (which should be www.mypoorlysite.com for the main site) to mypoorlysite.com avoiding the www. Now complete the process and select finish.

Open the properties of the newly created non-www site profile. Select the “Home Directory” tab. Select “A redirection to a URL”. In the “Redirect to:” field enter the full URL of the final domain i.e. http://www.mypoorlysite.com.
Finally tick the box labelled “A permanent redirection for this resource”, which switches it from a 302 to a 301 redirect.
Click apply and that it. If all is correct, http://mypoorlysite.com should now 301 redirect to http://www.mypoorlysite.com.
Situation 2
I have a site that has several domains pointing to it all of which suffer from canonicalisation. I’m running on IIS 6 and have set up a separate Website through this for each all pointing to the same folder.
Problem 2
My site renders for each of the domains and also for the non-www version of each of the domains. Here the problem goes beyond the www / non-www issue mentioned above as several domains are also in use i.e. www.mysite1.com, www.mysite2.com, www.mysite3.com etc.
I want everything to redirect correctly to www.mysite1.com including the non-www versions.
Solution 2
Firstly implement the solution 1 for www.mysite1.com. With this in place visit the properties of each of the other domains. Select the “Home Directory” tab. Select “A redirection to a URL”. In the “Redirect to:” field enter http://www.mysite1.com.
Finally tick the box labelled “A permanent redirection for this resource”, which switches it from a 302 to a 301 redirect.
Click apply and that it. If all is correct, the www and non-www versions of the domain you are redirecting should now 301 redirect to http://www.mysite1.com.
Useful Tools
Google Webmaster Tools – Here you can set your preferred choice as to whether Google should use the www or non-www version of your site. Sounds OK put personally I would rather sort that myself.
Redirect Checker – A handy tool for checking your redirect is a 301.
Related posts: