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.
The Differences:
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 then... ;) 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..
Shared Hosting Solutions and 301s
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
First off, this is NOT my own work - I'll admit this immediately. It's work I came across and felt valuable enough to share. Feel free to contact the original author and/or ask your own questions here at SEF (where you'll probably get a quick answer).
Second up is this: what I am posting is a few samples of code so folks can easily copy & paste them for their own use. The full article, with explainations, more 301 code samples and some useful tools can be found here.
Without further ado, I give you a few samples:
HTTP 301 Redirect in ASP-VBScript
HTTP 301 Redirect in PHP
HTTP 301 Redirect in ColdFusion
The article goes on to give examples for the following situations:
~ Redirection with mod_rewrite
~ Redirection with Javascript (often used as spammer tricks)
~ Redirection with META refresh tags (often used as spammer tricks)
It also covers the definitons of the 300 codes, provides a links resource list and offers a live exmple of redirecting in action.
My goal with this post was to create an easily found thread which covers the most common redirect instances for SEF users. It's a popular topic and hopefully this will help get folks targeted information quickly.
Duane
[ Message was edited by: Dinkar 03/27/2006 10:49 am ... Reason: replaced 'quote' tag with 'code' ]
[ Message was edited by: JimBot 03/30/2006 07:23 am ... Reason: Fixed Code Examples ]
Nope - just took half an hour and pulled it together. There's always folks looking for info on this topic, so now when they do a search, this should come up under a bunch of phrases ('301', '301 redirect', 'canonical', 'canonicalization', etc.).
Bottom line is should get them a good start on solving their concerns without having to read through the bunches of threads where we share all this type of info.
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
You have not yet logged in, or registered properly as a member
You are a member, but no longer have posting rights.
This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.