ss_blog_claim=f80c49302de8a7ebba6fad691a0ad6df 301 Redirect PR Leak Fix - Take More Risks
Take More Risks

301 Redirect PR Leak Fix

by Matt on , under Web Development

Since Google sees www.takemorerisks.com and takemorerisks.com as two seperate entities, I decided it was time to take action and correct the current PR leak by redirecting all takemorerisks.com requests to www.takemorerisks.com.

wwwtakemoreri.jpg

takemoreri.jpg

It’s interesting to see that takemorerisks.com is a PR2. If I left things as they are it’s possible that this value could increase – making it the difference between my blog achieving a PR4 and PR5. Or even worse…

To correct the problem I added the following lines to my .htaccess file

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

Now if you type http://takemorerisks.com you’ll be automatically redirected to http://www.takemorerisks.com If I wanted http://www.takemorerisks.com to redirect to http://takemorerisks.com I’d have used this.

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

It’s important to decide whether to use www. or not when you first start your site as it will prevent any of the problems I’ve outlined here. Google SEO expert Matt Cutts delves into greater detail in his SEO advice: Url Canonicalization post.

Update

If you’re using Wordpress and want domain.com/file.html to translate to www.domain.com/file.html you must position this code before the “RewriteRule . /index.php [L]” rule in the .htaccess otherwise visitors will be redirected to www.domain.com/index.php each time.

Here’s what my .htaccess looks like now.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# BEGIN re-direct code

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

# END re-direct code

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

3 comments for this entry:
  1. Nate Whitehill

    Great post! Very useful!

  2. Chris

    Just did this myself recently after finding I was PR4 for one and PR2 for the WWW. version.

    A waste of good pagerank! ;-)

  3. thepaperbull.com » in need of SEO advice on URL canonicalization

    [...] of blog URL’s; 301 redirects etc. I’ve found excellent resources through Matt at Take More Risks; Matt Cutts at Gadgets, Google and SEO as well as Nate at NateWhitehill dot [...]

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...