Cleaning Up Canonical URLs With Redirects



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.

URL canonicalization issues

URL canonicalization issues

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.vizaginformation.com instead of vizaginformation.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} ^vizaginformation\.com$ [NC]
RewriteRule ^(.*)$ http://www.vizaginformation.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} ^vizaginformation\.com$ [NC]” looks for when people access vizaginformation.com. The “[NC]” flag makes the test case-insensitive, so it catches URLs like SoCiAlPatTerns.com.

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

Make a Comment: ( 2 so far )

blockquote and a tags work here.

2 Responses to “Cleaning Up Canonical URLs With Redirects”

RSS Feed for SEO updates | SEM updates | Internet marketing updates | Affiliate marketing Comments RSS Feed

Hi, cool site, good writing ;)

Cool site, love the info.


Where's The Comment Form?

Liked it here?
Why not try sites on the blogroll...