Forum Moderators: phranque

Message Too Old, No Replies

301 redirect via mod_rewrite

         

BigBadBurrow

3:53 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



Hey everyone,

I'm having a problem with a site im working on. We've done some optimization of the site so that the keywords appear in the URL. The trouble is, how do we redirect the search engines from the old pages to the new ones? We have a lot of deep links where people have linked directly to the page itself, so we'd like to carry the PageRank from our old pages to our new ones.

Unfortunately the old pages are plain html files, so putting a redirect script directly in the file itself is not possible. So I was wondering would it be possible to do this: -

Note: the old page is called cat40.htm (for example)

1) create a new php file called cat40.php

2) put a 301 redirect script in cat40.php to redirect to the new page, e.g. /my-optimized-page.htm

3) use mod_rewrite to rewirte cat40.htm to cat40.php

I'm sure the system would work in a browser, but my question is whether the search engines will recognise the 301 redirect through the mod_rewrite and transfer the PR?

Any thoughts?

Many thanks,

BBB

ChadSEO

4:52 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



An even easier way to do this would be to just do the 301 redirect from cat40.htm to my-optimized-page.htm. Unless you're doing some database lookup to associate cat40 with "my optimized page", in which case your method would work as well. Just make sure you do a 301 redirect from both cat40.htm to cat40.php and from cat40.php to my-optimized-page.htm

BigBadBurrow

6:10 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



Do you mean doing a 301 redirect from the htaccess file?

I tried doing this but I got an Internal Server Error. The syntax was perfectly fine so I don't know what its problem was?! I'll try again and post what I have written in the htaccess file to see if I've made some glaring error.