3

I have an htaccess rewrite rule that rewrites if the file requested doesn't exist, but I would also like this rule to ignore this rule if the request falls within a specific directory. I am unsure how to do this however.

My current rewrite rule is this:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [L]

How would you modify to ignore a specific directory?

dqhendricks
  • 19,030
  • 11
  • 50
  • 83

1 Answers1

5
RewriteBase /
RewriteCond %{REQUEST_URI} !^/foldername
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [L]

Should do the trick

Thomas
  • 1,401
  • 8
  • 12