Question:

Apache rewrite rule help?

by  |  earlier

0 LIKES UnLike

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

 Tags:

   Report

3 ANSWERS


  1. 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]


  2. go to wikipedia and read mod rewrite section

    then follow the external link

  3. 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.

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions