Mapping in .htaacess file
I have a requirement to map an old domain to a different path on a new domain. Here is what I need to do:
I need a 1 to 1 mapping of this url: http://www.hikingsanfrancisco.com/san_francisco_hikes/windy_hill_regional_open_space.php
t开发者_如何转开发o now go to this url: http://www.comehike.com/outdoors/parks/park.php?park_id=1
My current .htaccess file looks like this:
Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*) http://www.comehike.com/$1 [R=301,L]
Redirect /outdoors/trees/tanoak.php http://www.comehike.com/outdoors/trees/129/Tanoak
So hopefully the new entry does not break the other ones :)
Thank you, Alex
Ok after many headaches this example worked:
RewriteRule ^outdoors/swift_bird.php http://www.comehike.com/outdoors/birds/bird.php?bird_id=1 [R,L]
The difference seems to be putting the [R,L] at the end of the line. But I can't explain why. Maybe someone else can. I just know that after I added it, this redirect started working.
精彩评论