Connecting Tech Pros Worldwide Forums | Help | Site Map

Help with RewriteRule

Newbie
 
Join Date: Apr 2007
Posts: 9
#1: Jan 17 '09
I'm trying to achieve the following:

anydirectory/index.php?query_str --> anydirectory/index2.php?query_str
anydirectory/anysubdirectory/index3.php?query_str --> anydirectory/anysubdirectory/index4.php?query_str

What I need is to do a 301 from a page inside a directory to another page inside a directory (it's the same page name for every directory in my website, so, I know which are both pages but not which is the directory as it could be anything)
Same thing with a subdirectory.

I tried with this, but I suck with RegExp:

RewriteRule ^(^/)+/index1\.php$ $1/index2.php [R=301,L]
RewriteRule ^(^/)+/(^/)+/index3\.php$ $1/$2/index4.php [R=301,L]

Any help on this?
Many thanks

Reply