Jim Westergren
About me, my projects, SEO, Web Development and Personal Development since 2005
"If we did all the things we are capable of, we would literally astound ourselves." - Thomas A. Edison

WordPress users - sharpen your URLs with Google!

Update: October 1, 2009

This article is from january 2006. In new versions of WordPress all the things in this article is being taken care of automatically. DO NOT USE IT ANYMORE.


First of all you must enable the permalinks, but that you probably already have done.

Now to the point. Did you know that these are all different URLs for the same blog post?

http://www.myblog.com/my-blog-post http://www.myblog.com/my-blog-post/ http://myblog.com/my-blog-post http://myblog.com/my-blog-post/

Google sees this as 4 different URLs and 4 different pages when in fact it is only one. One of them will rank higher in Google than the rest. This is called canonicalization problem and is discussed by a Google staff here.

Let's say you get a nice link to http://www.myblog.com/my-blog-post but in fact it is http://www.myblog.com/my-blog-post/ that ranks higher. This link is useless in terms of ranking!

The solution to get all 4 versions made into only one and to have all weight/power transferred to that one

Add the following lines in the .htaccess file before the WordPress permalinks lines:

Options +Indexes Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^myblog.com RewriteRule ^(.*)$ http://www.myblog.com/$1 [R=permanent,L] RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://www.myblog.com/$1/ [L,R=301]

That will make all posts go to this version: http://www.myblog.com/my-blog-post/

Just replace myblog before you add it and don't forget to still include the WordPress permalinks section in the .htaccess file.

Let me know any feedback, ideas, comments etc.

Update, November 28 2006

If this does not work or you use the non-www version for your blog you should use the solution provided by Christer Edwards on the comment here.

24 Jan 2006

About the Author Jim Westergren Jim Westergren is a Swedish web entrepreneur currently living in Spain. He is happily married and has three lovely children. Some of his interests are web development, SEO and writing.
He is the Founder of DomainStats and N.nu. Read his .