Exclude directory or folder from a rewrite rule in .htaccess

To exclude a directory or group of directories from rules in your .htaccess insert the following line before the rules in your .htaccess


RewriteRule ^(directory1|directory2)($|/) - [L]
  • 121 Users Found This Useful

Was this answer helpful?

Related Articles

Error 401 Unauthorized

This can occur when a web page requires authorization or a login to view the contents. If none...

Redirect website to https:// and www. via .htaccess

To forward a website to use both www. and https:// use the following in an .htaccess file:...

vBulletin fsockopen() [function.fsockopen]: unable to connect

When setting up mail in vBulletin be sure you are using localhost for the mail server along with...

Reseller: Unable to find an ip address in when creating an account.

When creating accounts be sure to select a package in the package field. You can create a package...

Enable Mod Rewrite

Create an .htaccess file with the following contents and upload it to your public_html directory....