How redirect your domain to point to the one with the higher PageRank

2007 April 29
by Costa

After this round of PR update from Googles some bloggers found that their blogs has 2 different Page Ranks. One for the URL with the www prefix and another one without the www prefix. There is a way to redirect this so that everything points to the URL with the higher ranking. Lyndonmaxewell and Paris, these are the codes that I was talking about to solve your PR problem.

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com and vice versa

I think most Wordpress Users already have a .htaccess file in their root directory which can be accessed via your cPanel. Just make the neccassary changes in Notepad then copy and paste it there. Be sure you don’t touch anything that is already in the file if there is any.

To redirect domain.com to www.domain.com. ( Please REPLACE domain.com and www.newdomain.com with your actual domain name.)

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

Vice Versa, to redirect www.domain.com to domain.com

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

More info on redirection can be found at:

Webweaver

webconfs.com

Other Interesting Topics

4 Comments leave one →
2007 April 29

Gua cayang sama lu. You made the instructions so easy, not like what I read from John Chow until kepala pusing. My www has pr4 but chanlilian.net has pr 5

[Reply]

2007 April 29

wah! This is so technical! I’ll have to read it back slowly so I can work it out hehe… but thanks Ah Pek! Then again, I checked on another PR checker site and both www and without www showed the same PR. How ah?

[Reply]

2007 April 30

hey thanks for the advice! I’m off to temper with the settings. *grins.

[Reply]

2007 May 1

hi ahpek,

I am glad I found this. Thanks for the tips, it really works! :)

[Reply]

Leave A Comment

Note: You can use basic XHTML in your comments. Your email address will never be published.