Question:
Apache rewrite rule help?
2008-09-02 09:28:13 UTC
The only directory structure to change is browse to parts. How do I apply a rule in apache to successfully redirect.

Old
site.com/browse/games/en1873
New
site.com/parts/games/en1873
Three answers:
john p
2008-09-04 02:39:52 UTC
Quite simple. Just use:



RewriteRule ^/?old_directory/([a-z0-9/.]+)$ new_directory/$1 [R=301,L]





So in your case the following will work good:



RewriteRule ^/?browse/games/([a-z0-9/.]+)$ parts/games/$1 [R=301,L]
Cristiano
2008-09-02 09:32:08 UTC
Go to http://www.addedbytes.com/ and look for the cheat sheets. There's a great cheat sheet for Apache rewrite that will help you with that.
2008-09-02 09:58:31 UTC
go to wikipedia and read mod rewrite section



then follow the external link


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...