Canonical URL Tool

When I create a new website, one of the very first things I do is a simple trick with mod rewrite that let’s me tweak the site for better search engine optimization.

This tool I’ve created makes it easy to set it up so that

  1. Your website url will always have “www” in front of it
  2. Links with index.php or index.html will be rewritten so that the index is removed and the trailing slash is used

Some SEO gurus believe that this gives yours site an extra little bump by not being penalized for duplicate content. In short, you want all of your incoming links to a certain page on your site to appear to all target the same page.

There’s evidence to indicate that Google sees the following urls differently:


This tool requires you to have a web server running Apache and access to mod_rewrite.

All you do is enter your domain, hit the button, and you get some code you can copy and paste into your .htaccess directory (at the end) and you’re good to go.

As with any changes to your .htaccess file, make sure you do a backup before you upload the changes.

Canonical URL Tool


#1 The 30 Second Search Engine Optimization Tweak | Website tutorials and tools on 04.05.07 at 8:30 am

[...] RSS ← Canonical URL Tool [...]

#2 Tim on 06.27.08 at 7:33 am

That is one cool tool. I found that I was having a problem on my sites, used your tool, and bam all fixed. Do you feel that when you are seeing this problem that google thinks or feels that it is dupe content???

#3 Jack on 06.27.08 at 8:26 am

I’ve heard time and time again that Google treats content on http://www.yoursite and yoursite as different content and at the very least this hurts your page rank, link flow, link juice, link mojo, or whatever you want to call it.

And since it takes 2 seconds to fix, I do it.

#4 Nahtass on 09.15.08 at 6:15 pm

Technically speaking, the ‘www’ part is handled in a number of ways. In the DNS world it is often a C-Record that you will alias.

The ‘www’ can also be a valid A-record that points to some place.

It may also be a forward (variant on C-Name + alias)

On many virtual hosting environs ‘www’ almost operates like a mirror.

Some virtual hosts will treat it like a subdomain via the local (server based) DNS system.

There are about 10 more ways you may look at the ‘www’ thing. Many if not most SEO people with -valid- experience and understanding of servers and most specifically DNS will tell you to drop the ‘www’ every chance you can. If you can not drop it, forward it.

The ‘www’ is dead, trust me. There is little reason to use it because it can and will interfere with results because how the hell does Google know the status? Subdomains are very helpful. Subdomains in conjunction with a solid understanding on DNS+ will allow you to have VERY effective SEO.

As far as google treating it different with and without ‘www’ that is TRUE and FALSE. True in that, well, it may go that way.

FALSE because most of the time ‘www’ and non-’www’ are served from the same IP, same server, same page weight (kb), same content, and same meta-architecture. Just a simple WhoIs can allow me, a human, to tell what is going on:

Drop into the command line and fire a ping, tracert, nslookup, etc (windows) and you quickly know if ‘www’ is the same or different. oogle is WAY WAY ahead of us humans. I woudl expect an early routine that compares the result set between the 2 (‘www’ and non-’www’) and the makes a decision.

Hope this helps


Leave a Comment