What the heck is a canonical URL? I didn’t know what a canonical URL was at first either, so don’t worry if you don’t know.

Canonical essentially means “standard” or “authoritative”, so a canonical URL for search engine marketing purposes is the URL you want people to see. Depending on how your web site was programmed or how your tracking URLs are setup for marketing campaign, there may be more than one URL for a particular web page.

The problem most search engine marketers run into deals with domains. Sometimes if a domain is not setup properly, the domain URL (domain.com) and the www domain URL (www.domain.com) are considered individual web pages. Since both pages maybe indexed by Google – you could get hit for duplicate content and at the very least you would be splitting your link popularity.

The easiest way to protect your site is to redirect all forms of your domain to one “standard” URL – a canonical URL.

For example to force the use of www.socialpatterns.com instead of socialpatterns.com, I have these lines in my .htaccess file. (This is Apache specific, if you use IIS the lines should be the same using ISAPI filter)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^socialpatterns.com$ [NC] RewriteRule ^(.*)$ http://www.socialpatterns.com/$1 [R=301,L]

The first line “RewriteEngine On” tells Apache to enable Mod_rewrite – the engine responsible for manipulating URLs.

The second line “RewriteCond %{HTTP_HOST} ^socialpatterns.com$ [NC]” looks for when people access socialpatterns.com. The “[NC]” flag makes the test case-insensitive, so it catches URLs like SoCiAlPatTerns.com.

The third line “RewriteRule ^(.*)$ http://www.socialpatterns.com/$1 [R=301,L]” redirects socialpatterns.com to www.socialpatterns.com with a 301 redirect.

Leave a Comment

Contact Us

Send us a message about your SEO, Marketing and Web Design Needs! We are here locally in Roseville, CA, so don't be shy!

Not readable? Change text. captcha txt

Start typing and press Enter to search