14th Colony

Thu 28 August 2008

14thC: Membership has it's privileges - Register Free


Subscribe via email!

Get the latest 14th Colony content delivered to your inbox. Just enter your email address:

 Subscribe in a reader


Subscribe with Bloglines Add to Technorati Favorites



Search 14th Colony


Advertise on 14th Colony!


Spread your message!


Seeing Double: Fixing canonical issues in the search engines

Randall McCarley
by Randall McCarley
October 15th, 2007

Just enter your domain and select your TLD and whether you want the “www” to be part of the final URL and this neat little tool will generate the code for you.




Explanation

One of the most basic elements of Search Engine Optimization is making your site easy for the search engines to understand. A common problem is many sites actually have 2 versions floating out there: a www version (www.14thc.com) and a non-www version (14thc.com). They are actually the same site but the search engines are seeing double which leads to two very serious problems.

  1. Duplicate content issues. This is especially damaging in Google. When Google detects the same content on two web pages it drops one of them. This is to make their results more relevant and to reduce spam.
  2. Link juice. Each link pointing at your site is like a vote for its favor. The more links you get, the more likely you will come up at the top of the search engine results pages. But if some of your links point to the www version and others point to the non-www version the cumulative links pointing to your site are split. By combining the two versions of your site you get the total credit of your backlinks in one place making your site more powerful in the eyes of the search engines.

The best fix for this is by hacking your .htaccess file and merging the two versions. This sounds scary but it is pretty strait-forward. You can copy this code and make the adjustments yourself or use the form below to auto-generate the code for you.

RewriteEngine on
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} !^www\.YOURDOMAINNAME\.com [NC]
RewriteRule ^(.*) http://www.YOURDOMAINNAME.com/$1 [L,R=301]

Change the part that says “YOURDOMAINNAME” to the name of your actual site. And swap out the “.com” for whatever TLD you use (.net, .org, etc.).

Important Notes: This only works with Linux-based servers, not Windows. Not all hosts support or allow access to the .htaccess file. Ask your web host for help if you need it.

Once you have the code, save it as .htaccess (yes, with the period in front). Then FTP it to the top directory of your web site.

To test if it worked try typing your URL without the www prefix in your browser address bar. It should redirect to the www version.

What if I want to point the www to the non-www version?

No problem! Just remove the www. prefix from the last line of code.

RewriteEngine on
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^www\.YOURDOMAINNAME\.com [NC]
RewriteRule ^(.*) http://YOURDOMAINNAME.com/$1 [L,R=301]

I wanted to thank a couple people in particlar for helping me make sense of the .htaccess issues including Wit and Nintendo. .htaccess is good for other stuff too like making static URLs out of dynamic ones and redirecting file types and individual web pages.

And mention that Google Engineer Matt Cutts talks about canonical issues at his blog.