PageRank Mysteries and the 301 Redirect | Search Engine Optimization (SEO) | PageRank

Google AD


Wednesday, February 7, 2007

PageRank Mysteries and the 301 Redirect

PageRank Mysteries and the 301 Redirect
The problem: Your content is at http://www.yoursite.com/, but some people have been linking to http://yoursite.com/. You've noticed that http://www.yoursite.com/ is PR5, but http://yoursite.com/ is only PR3, even though it's the same site.

The trouble is, the search engines don't realise that the site is identical. They're confused, but you can help them sort it out with a 301 (permanent) redirect. If your site runs on the Apache webserver, you're in luck. It's easy to implement a 301, just by adding to (or creating) your .htaccess file, located in your web root directory.

Why it's important: You need to get the situation sorted out, because you're not getting proper credit for links to http://yoursite.com/. Those links could help you rank better on certain keywords. In other words, you're not getting all the traffic you could be getting.

If you want to redirect http://yoursite.com/ to http://www.yoursite.com/, your .htaccess file needs to contain these lines:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com [NC]
RewriteRule ^(.*) http://www.yoursite.com/$1 [L,R=301]
If you want to redirect http://www.yoursite.com/ to http://yoursite.com/ it should contain these lines, instead:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^yoursite\.com [NC]
RewriteRule ^(.*) http://yoursite.com/$1 [L,R=301]
If you want to know more about what's going on, you'll need to learn about regular expressions, and mod_rewrite. Both are beyond the scope of this article.

A similar problem can develop if you move files around on your website. For example, if you have a file located at http://www.yoursite.com/about/, and you move it to http://www.yoursite.com/about-us/, you can set up the following 301 redirect:

Redirect permanent /about http://www.yoursite.com/about-us/
The "permanent" argument tells Apache to issue a 301 code, meaning that the change is permanent, users should update their bookmarks, and search engines should update their listings accordingly. This is almost always what you want. The full path is required for the new destination URL. To learn more, read up on the Redirect directive in the Apache mod_alias documentation.

No comments:

PageRank Mysteries and the 301 Redirect | Search Engine Optimization (SEO) | PageRank