Trackback URI | Comments are closed.
301 Redirect (Canonical URL), Simple How-To
by Amy Stevens Adams
Who cares about a Canonical redirect? I do.
Lately I’ve been investing all my time into optimizing our blog. I found a great website called Hubspot, that links to a Website Grader. I’m making my way through the list of recommended improvements, and so far the most confusing has been the 301 redirect, otherwise known as a Canonical Redirect.
Here’s the scoop. Right now, your website might use both http://www.yourdomain.com and http://yourdomain.com. Either address is valid for your site. At first, it seems like this is good, as it it increases accessibility and simplifies things. However, it’s not good. What is happening, is that Google (and other search engines) think that those two addresses are two entirely different websites. Now each of your ‘two’ sites gets different page ranks in the search engines. All your hard work to optimize your site and move your way up in the Google ranks is being diluted. The answer, is a canonical redirect (also known as a 301 redirect). Canonical simply means ‘authoritative’. So whichever address you choose to go with will be the authority and Google will only rank that one. For some of you, this may make a huge impact and you will see your ranking go way up as your ‘two’ sites join forces. For the rest of us (still fighting our way into the fickle heart of Google), it will show over time as our SEO efforts are rewarded much more quickly.
How do you know whether to use the www or not? Basically it doesn’t matter. Look at what the majority of your links are already, and go from there. I went into my WordPress dashboard, in the Settings section, under General, and I found that my blog url was already set without the www. That means that every time I’d copy my blog url and post it somewhere, it was sans www. That made my decision easy.

The Canonical URL for CCB is now http://capecodbranding.com. This doesn’t mean that we won’t get the visitors that type in the www’s. If you go to http://www.capecodbranding.com you’ll see in the address bar that you were automatically redirected to http://capecodbranding.com. This is why it doesn’t really matter which you choose.
Now that you know the ‘why’, lets go through the ‘how’. This takes a tad of technical know-how to pull off.
If you use FTP to upload to the web, then you’ll need to locate your .htaccess file and open it to edit it. I found mine (I use Dreamweaver), by going to the ‘remote view’ in my Files section and it was listed first (b/c of the “.”) in my public_html file. I opened it in Dreamweaver and added this bit of code;
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^www.capecodbranding.com [nc]
rewriterule ^(.*)$ http://capecodbranding.com/$1 [r=301,nc]
This redirects WWW.capecodbranding.com to just capecodbranding.com.
To do the opposite (and have an end result WWW.domain.com be your canonical url), use this code;
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
Once you’ve entered it, save the file and upload it with your FTP manager.
That’s it!
Now, if that seems too daunting, some hosting companies, mine included, will do the dirty work for you. I didn’t realize this until after I’d spent 2 days doing Google searches on how to set up my 301 redirect.
However, it turns out that iPowerWeb (who I’ve used since 2004 and love) will take care of it for you if you call tech support. Alternatively, you can log into iPower’s Control Panel and access the .htaccess file there. Open the “.htaccess Editor”, then choose “Direct Editor” and from there just copy in the code (from above). Then click save. With that version there is no need to use FTP.

I’m not sure about other hosting companies, but it doesn’t hurt to call and ask if they’ll do it for you.
What I found is that after 2 days of feeling intimidated about accomplishing the 301 redirect, when I finally did it, it was simple. I hope you find it to be the same experience!
-Amy Stevens Adams of Cape Cod Branding
One Response to “301 Redirect (Canonical URL), Simple How-To”
[...] a recent article on Canonical Redirects, I mentioned a company called Hubspot that offers a free Website Grader. It’s pretty simple, and [...]