.htaccess rewrite rule to exclude folder

Many times you need to have a folder not included in your .htaccess file’s rewrite rules. In order to exclude or skip the following can be done as part of the rewrite statement to allow this. This rule would be added after the last condition before you main rewrite rule you are preforming.

RewriteRule (^folder1|^folder2) – [L,NC]

You can add as many or as few folders as you wish. Just follow the same format of |^folder3

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.