canonical domains » The SEO Hobbyist

What is the Canonical Domain Issue?

This occurs when there isn’t a Permanent Redirect (301) found at the root level of your domain. If not configured properly, search engines will treat your domain “http://example.com” and “http://www.example.com” as two different sites. This can seriously hurt your rankings! We will use that same domain name in the code examples in this tutorial.

Why is it so Critical?

This issue gets so much attention because it’s such a simple mistake that can hurt your rankings an incredible amount. It also gets written about often because the fix is relatively simple (with the proper instruction).  Follow the instructions below to make sure you get the “Full Credit” from every search engine.

How Can I Check My Website for This Canonical Domains Problem?

The easiest way to test if your site has this issue is to run it through one the following analyzers.

They both will tell you very clearly if there are any canonical domain erros, as well as provide you other information about your domain that is often over looked.

Here’s How to Fix It:

There are many ways to fix the canonical domain issue.  The first example is by using an Apache .htaccess file with the following contents. If your preferred name is http://www.example.com, then add the following to a blank text file named .htaccess, and upload it to the domain root:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]

Conversely, If your preferred domain is http://example.com then your last two lines would be:

rewritecond %{http_host} ^www.example.com [nc]
rewriterule ^(.*)$ http://example.com/$1 [r=301,nc]

If you website is built in PHP, you can fix it with the following code snippet:

<?php
if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI']);
}
?>

And Finally, a 301 Canonical redirect using ASP:

<%
If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www."
& Request.ServerVariables("HTTP_HOST")
& Request.ServerVariables("SCRIPT_NAME")
End if
%>

How Can I Verify The Fix?

After making the above changes, re-run your website through the analysers that I linked previously. The fix should take effect immediately.

I hope found this article informative. If you have any questions or comments, feel free to enter them below.

<p style=”padding-left: 30px;”>r

I frequently get asked by readers to review their websites and give feedback on some simple changes they could make to improve their SEO. Universally, these are the top 5 problems I find that are easy to fix. Granted, they aren’t the ultimate solution by any means, but instead they are just easiest changes one can make that have the largest benefits.

1) Register your domain for longer than one year.

Believe it or not, all of the top search engines run some sort of background check on every domain they index. They compare your server’s IP address to make sure it isn’t listed on any spam blacklist, as well as performing WHOIS lookups to make sure your domain isnt registered by any known spammers. Another thing they look for is length of registration. If your domain is registered for longer than a year it shows the search engines that the owner is committed to the domain, and there is a lower likelihood that is a spam website. (Most spam websites are registered for short periods or time.)

2) Beware of Canonical Domains

This is the biggest killer of SEO rankings that I come across. It has a scary name but its really a simple idea. If you do not setup your domain name correctly,
example.com will be treated as a completely separate site from www.example.com. Check out this post on How To Fix the Canonical Domain Issue.

3) Utilize Free Tools

http://google.com/analytics
http://websitegrader.com
https://www.google.com/webmasters/tools

4) Monitor and track your changes

5) BE PATIENT!

Many beginner webmasters expect for changes to happen overnight. It can often take weeks, even months to really benefit from the SEO tips found on this blog.