How to exclude a sub-folder from HTaccess RewriteRule
- by amb9800
I have WordPress installed in my root directory, for which a RewriteRule is in place.
I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such.
Problem is that the root htaccess RewriteRule is applying to "blue" and thus I get a 404 in the main WordPress site (instead of opening the password dialog for the subfolder).
Here's the root htaccess:
RewriteEngine on
<Files 403.shtml>
order allow,deny
allow from all
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I tried inserting this as the second line, to no avail:
RewriteRule ^(blue)($|/) - [L]
Also tried inserting this before the index.php RewriteRule:
RewriteCond %{REQUEST_URI} !^/blue/
That didn't work either.
Also inserted this into the subfolder's htaccess, which didn't work either:
<IfModule mod_rewrite.c> RewriteEngine off </IfModule>
Any ideas?