301 Redirect only for one 1 directory

Discussion in 'Apache' started by Webase, Apr 21, 2006.

  1. #1
    Hi, I have these lines:
    <IfModule mod_rewrite.c>
    RewriteEngine On 
    RewriteBase / 
    RewriteRule ^reviews/(.*)\.php$ details.php?name=$1 [QSA]
    RewriteRule ^(.*)\.php$ index.php?p=$1 [QSA]
    </IfModule>
    Code (markup):
    How can I make the RewriteRule ^(.*)\.php$ index.php?p=$1 [QSA] only apply for one dir level (ie. works for /hosting-articles.php but for /reviews/stuff) ?

    It's because after going through RewriteRule ^reviews/(.*)\.php$ details.php?name=$1 [QSA] it goes to RewriteRule ^(.*)\.php$ index.php?p=$1 [QSA] and ruins it... lol...

    Thanks in advance guys!
     
    Webase, Apr 21, 2006 IP