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! 🙂
No Comments