Redirect visitor to PR URL

Apache How to redirect visitor to domain which have more PR?

Requirement:
– Apache
– htaccess enabled.

Case 1, PR is on domain.com
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule .* http://domain.com/ [L,R=301]

Case 2, PR is on www.domain.com
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule .* http://www.domain.com/ [L,R=301]

How to use:
– Choose one of the case above.
– Copy the code and paste in text editor, such as notepad. Do not use wordpad!
– Save it as .htaccess
– Upload the file to your document root folder (web accessible).

This method can be also used for preventing search engines penalties because of having duplicate content on your domain.com and www.domain.com

Good luck! 🙂

Tagged with 
About sepedatua
I am nothing special, of this I am sure. I am a common man with common thoughts and I’ve led a common life. There are no monuments dedicated to me and my name will soon be forgotten, but I’ve loved another with all my heart and soul, and to me, this has always been enough.

Leave a Reply