1

I have this rule in my htaccess

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule !\.(js|ico|gif|jpg|png|bmp|swf|css|html)$ public/index.php [QSA,L]

And now I want to add one or two exception folder. Can anyone help? Really appreciate.

Scramble
  • 119
  • 10
  • Exact Duplicate: http://stackoverflow.com/questions/1848500/htaccess-mod-rewrite-how-to-exclude-directory-from-rewrite-rule – Mike Oct 25 '14 at 03:41

1 Answers1

3

You can add a new RewriteCond for creating exceptions for 2 folders:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/(folder1|folder2)/ [NC]
RewriteRule !\.(js|ico|gif|jpg|png|bmp|swf|css|html)$ public/index.php [NC,L]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • Is this more kind than turn off the engine? – Scramble Oct 28 '14 at 02:07
  • Turning off the rewrite engine will require you to create a .htaccess in each and every folder in your exception list and here you can do all that from root .htaccess – anubhava Oct 28 '14 at 05:48