I've just archived an old site to an area on a new website. I've tried to redirect stuff so that Google doesn't lose it, and I've managed to do the main pages manually using mod rewrite, but I'm can't get an overall script to work. Here is the problem in detail.
1. Site has moved from www.XXX.com to www.YYY.com/archive/www.XXX.com
2. Google shows search results to www.XXX.com/mypage which are being redirected to www.YYY.com/archive/www.XXX.com/mypage, but this is throwing up a 404 as actually it should go to www.YYY.com/archive/www.XXX.com/mypage.html
3. So I'm trying to set up a mod rewrite that says any request for mypage should go to mypage.html
I tried using this from the FAQ (obviously replacing .php with .html):
- Code: Select all
# Redirect to remove .php
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule ^(.+)\.php$ /$1 [R=301,L]
But what happened was links to www.XXX.com/mypage went to www.YYY.com/mypage.html, I need the path to remain.
Any help much appreciated. Please let me know if I've not been clear or you need more info.
Thanks,
Asher