Go Back   Web Design & SEO Company > Knowledgebase

Knowledgebase Articles and information about running a website, cPanel and various hints and tips. Here you will find tutorials on php, MySql, .htaccess, cron, SEO, Search Engines, CHMOD, FTP, CSS, HTML and various other hints and tips on running and Administrating a website.

Prev Previous Post   Next Post Next
Old 04-20-2007, 02:41 PM
Admin's Avatar
Join Date: Jan 2007
Location: Taree
Posts: 613
Default Canonical URLs With 301 Redirects - Important SEO

Canonical URL's - Brief outline of .htaccess first

This is the special file that sets up the deal for you. It can contain all sorts of directives for the Apache server. If you’re not using an Apache-based server, you’ll have to read your server’s manual on how to do it.

Look in your root directory, the place where your homepage is, for this file (.htaccess). If it's not there don't fret, you can just create it afresh and it won't make any difference. When doing so, just make an empty text file in Notepad or whatever, and make sure you start the filename with a dot — it's vital. This means that it is no longer a text file — the file suffix will be .htaccess, so it doesn't have a filename of its own.

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

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

The problem lies in how Google views each of these urls. Even though DNS typically points the two urls to the same website, Google will consider the two urls as seperate sites without a 301.

This will "split" your pagerank, so if 50 people link to the http://domain.com version, and another 50 link to www.domain.com Google wont see your website as having 100 backlinks and awarding the value of 100 backlinks to the 1 URL. So you will most likely end up having a PR2 on each version, were you may of obtained a PR4 on the 1 link.

Happy rewriting
Reply With Quote
Top SEO Tool
Harvester and Mass Blog Commenter
Blog Comment Software


Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Should I use short or long urls on Social sites jennypretty SEO 0 04-07-2013 10:33 PM
Important Things In SEO Palaimon SEO 17 02-16-2011 09:29 AM
Canonical Issues and its Types Danielnash SEO 2 12-30-2009 09:49 AM
Best SEO tips for Affiliate long URLs jennypretty SEO 3 08-28-2009 10:11 AM
What is Important for Google? seoma01 SEO 3 07-06-2009 06:05 AM
Please advice me about blog redirects albertseo SEO 2 03-24-2009 02:11 AM
rel=canonical" - New Google Attribute shennon SEO 7 03-05-2009 01:38 PM

Knowledgebase | SEO | Free Scripts | Free Wordpress Themes | Free Graphics

eval gzinflate base64 decode | SEO Addons

Forum time zone is GMT. Currently it's 10:57 AM.

SEO - Top

Web Design & SEO Forums