dqhendricks
dqhendricks

Reputation: 19251

htaccess url rewrite if file doesn't exist *OR* specific directory

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?

Upvotes: 3

Views: 3837

Answers (1)

Thomas
Thomas

Reputation: 1401

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

Should do the trick

Upvotes: 5

Related Questions