I'm trying to have htaccess do the following
redirect all request from site.com/ to subdir 'subdir' except if request uri starts with /mantisbt/
I used the following code from this answer (https://stackoverflow.com/a/5793784/1839903) and added a condition (line 4) but it is not respected.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?site.com$
RewriteCond %{REQUEST_URI} !^/subdir/
RewriteCond %{REQUEST_URI} !^/mantisbt/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?site.com$
RewriteRule ^(/)?$ subdir/index.php [L]
I'd like to mention that in subdir/.htaccess, I have required htpasswd user, and when I go to site.com/mantisbt/whatever it asks me for a valid user/pass (not the standard mantisbt login, a browser directory protected access). If I remove all Rewrite rules and conditions, then site.com/mantisbt/whaterver is working as expected, but of course, site.com/? is not served by files in root/subdir.
I hope my question is clear, please request more info if necessary.
Thanks for your help,