Concentrate Your Pagerank With Htaccess Redirect

Tags: Code Snippets htaccess index.htm non www pagerank redirect root www

People (or you) can link to you to your homepage using four different urls:

http://www.domain.com
http://domain.com
http://www.domain.com/index.html
http://domain.com/index.html

So you are dividing your one page’s pagerank amongst those urls. What you want is for those urls to all be 301 (permanent) redirected to one page, optimally one without the index.html (since later on you may choose to use index.php or other). This can be accomplished with a few simple .htaccess redirects.

First thing you want to do is choose whether you want www.domain.com or domain.com

domain.com >> www.domain.com

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

www.domain.com >> domain.com

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

Replace domain.com with your domain.
Source: enarion.net

Then you want to redirect your index.html/htm/php/any other extension to the folder

Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.domain.com/$1 [R=301,L]

Replace index.php with your index.extension and www.domain.com with your domain
Source: Search Masters

Put it into your root folder and viola! You’ve just concentrated 4 pages of pagerank into one!

If you enjoyed this post, be sure to subscribe for updates or at least bookmark this below.

Liked the post? Bookmark it.
Bookmark to Del.icio.us Bookmark to Digg Bookmark to Furl Bookmark to Ma.gnolia Bookmark to Netscape Bookmark to NewsVine Bookmark to Reddit Bookmark to Simpy Bookmark to Spurl

One Response to “Concentrate Your Pagerank With Htaccess Redirect”

  1. Don’t forget about all the Redirect Directives that you can use in htaccess… some people don’t have mod_rewrite, and the Redirect Directives are easier..

    http://www.askapache.com/htaccess/seo-search-engine-friendly-redirects-without-mod_rewrite.html

Leave a Reply
All comments & trackbacks are now followed by search engines!