Forum Moderators: phranque

Message Too Old, No Replies

.htaccess 301 Redirect to preserve PageRank. How?

         

shafaki

11:38 pm on Oct 5, 2005 (gmt 0)

10+ Year Member



Google says to use a perminant redirect (301) when changing a url in order to preserve ranking:
[google.com...]

I have a site www.first.com and want to "perminantly redirect" all its pages to a new domain www.second.com. What exactly do I write inside the .htaccess file (present in the root folder of the first domain) in order to achieve this effect (thus preserving the Google PageRank of all the redirected pages from the first domain to the second domain)?

I'll GREATLY appriciate a reply that solves the problem.

jd01

5:31 pm on Oct 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, we normally do not code on demand, but there are a few things you can do...

First try this or something similar in your favorite SE
'301 redirect to a new site' site:webmasterworld.com/forum92/

(It will look something like the following)
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]

Second
Check the Library [webmasterworld.com] and the Charter [webmasterworld.com]

Then let us know when you have something and we will be glad to help you with any issues from there. (I know the code you are looking for and how it works has been posted here on a number of occasions, so you should find it with the search.)

Justin

shafaki

10:50 am on Oct 13, 2005 (gmt 0)

10+ Year Member



In order to make a perminant 301 redirect from all pages in the OLD site to their equavalant pages in the NEW site, I created an .htaccess file and put it in the root folder of the OLD site as follows:

.htaccess of OLD site:

RewriteEngine on
RewriteRule ^(.*)$ [new-site.com...] [R=301,L]

This seems to work as I have tried it by visiting some of my old pages and finding my browser automatically going to their eqavalent in the new site (after slight delay though).

But my question is, those lines I used above in the .htaccess file, are they the ones that Google asked for and will make search engines learn that those pages have perminantly moved to the new location? (in order to preserve page rank)