Execute for all EXCEPT certain folder

Discussion in 'Apache' started by Wyla, Nov 24, 2007.

  1. #1
    my current .htaccess code is

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
    RewriteRule ([^/\.]+)/$ script.php?a=$1 [L]
    
    Code (markup):
    This basically masks
    domain.com/script.php?a=anything-they-type
    to
    domain.com/anything-they-type/

    Currently, I have a folder at domain.com/foldexists/ but when I try to go there, the htaccess rule comes to play and instead of viewing the contents of that folder, I see domain.com/script.php?a=foldexists

    How can i make it so that that condition doesnt apply to foldexists?
     
    Wyla, Nov 24, 2007 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    RewriteCond %{REQUEST_URI} !folderexists
    RewriteRule ([^/\.]+)/$ script.php?a=$1 [L]
    Code (markup):
     
    joebert, Dec 15, 2007 IP