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?
RewriteRule ^(blue$|blue/) - [L]
I also tried some stuff later after it and it seems to be the case. Also make sure you put this rule at the at the begin and not after your other rules so it takes places as soon as it hits