Canonicalization is the formal phrase used to describe the relationship between the www. and non-www version of a domain name. Derived from canonical, meaning (in mathematics) “A standard way of writing a formula”, for our purposes the actual meaning is somewhat skewed.
First and foremost – what server are you on? That’s a critical bit of info you’ll need to determine which form of redirecting is to be used, and how to implement it. Your choices are basically a Linux based server (running Apache, etc.) or a Windows based server running, ah, Windows (would you believe? ) If you’re on a Linux/Apache set up, meet the .htaccess file – it’s your new best friend. With this powerful little fellow, you’ll quickly and easily be able to create one document which can house all of your redirect instructions. easy to edit on a text editor (such a UltraEdit – DO NOT use MS Notepad, etc. – use a dedicated text editor). Anyway, it’s important to note the following about the .htaccess file:
1 – your text editor will likely NOT allow you to save the file as .htaccess – instead, you’ll start by saving it as htaccess.txt.
2 – after you upload this file to your server (via FTP or through the server interface), you’ll want to rename it as .htaccess – please note – there is a “dot” before the word, and NOTHING after it. Your server will recognize the file and handle requests properly – provided you’ve written them correctly.
3 – if your site suddenly disappears, or does wonky things, it’s safe to say your coding in the .htaccess file is off – one wrong character, inadvertant space, etc. can throw this off – SO BE CAREFUL.
“What was that?” You say you’re on a Windows server? Well, YOU have some challenges the Just kidding. The basics are the same, though how they’re implemented will differ. The best approach I can offer for this is to make the redirect changes directly on the server itself. You may want some help from your SysAdmin for this. I’ll admit here, I’m still elarning the actuals on this process, but since we use Windows servers here at work, I’ll have it covered shortly. Feel free to fill in this obvious lack of useful knowledge with details if you know them.
This is a tough one – not technically, but rather because my own experience, and that of others, points to a real problem here. If your host is unwilling to implement 301 redirects for you (to cover the non-www to www redirections, for example), there’s little you can do, since you have zero access to the server. Get as upset as you like that they DON’T provide this basic service, they likely won’t care. One solution is to find a host who’s willing to work with you on this stuff and move to them. Another may be to embed 301 redirects directly into each moved page. This requires leaving old pages up, though, and is not the best way to handle this problem.
The Trouble & Why We Bother:
In a nutshell, some of the engines, smart as they are, have trouble seeing the following as the same site: http://domain.com & http://www.domain.com We clearly know it’s the same content, same site, etc. The engines, though, see this as the same content residing at different URLs – hence, duplicate content. Now, for the most part this is not a complete deal-breaker in obtaining high rankings with the engines organically…provided no one else has it sorted out. If your competition has this covered, you’re toast. Best bet then, is to make sure that the non-www version of your domain redirects to the www version of the domain.
How to do this the right way:
Well, the safest way is via the 301 redirect. This is a way of informing the spiders that content has moved from where they have it indexed to a new location. It also ensures the passing along of some of the Page Rank value your old page may have built up. While nothing is ‘complete’, ‘total’ or ‘guaranteed’ online, this is the safe way to redirect moved content. Before you ask – “Are there other ways?” – yes they are, though be VERY careful when redirecting users/spiders – too many people have used blind redirects as a spam tactic, so if YOU decide to shuffle folks around all over the place WITHOUT using the 301 code, well, I WILL tell ya , “I told you so.” when things go wrong.
Example of 301 redirect codes and when to use them
Further topic-related resources: Please refer to the W3C.org page on code definitions as well, for useful data on server codes. VERY comprehensive article here with CLEAR directions on what to AVOID when redirecting. Bit on the “sales” side of things, but still useful.