I have a site which redirects all requests for files/folders which don't exist to an index file using .htaccess:
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule !admin/* index.php [NC,L]
There is a folder "admin/" which has the following in .htaccess for auth:
AuthType Basic
AuthName "admin"
AuthUserFile "/path/to/passwd"
require valid-user
Adding the auth .htaccess file in "admin/" causes the request to be trapped by mod-rewrite instead of providing the authentication response. I've tried a few different things trying to work around this (including this: http://stackoverflow.com/questions/1641666/htaccess-rewrite-and-auth-conflict), but couldn't get any purchase.
Thanks.
EDIT: If I'm already authenticated, the rewrite rule works allowing me to access the "admin/" folder. So it seems that it's the authentication challenge that's doing something wonky.