Forum Moderators: phranque
I am very nearly pulling my hair out over this. I have a site with a subdirectory for admins only, which I want to block using digest authentication. I also want just about every URL to be re-written using mod_rewrite. I can get everything working just fine independently, but if I try to get both working together, I only get 404 errors on the admin page. Here are my apache rules. Currently, they are in an htaccess file for testing, but I plan to move them to the httpd.conf once I figure out the correct directives.
In the /admin subdirectory. Users browse here by entering www.url.com/admin
/admin/.htaccess
AuthType Digest
AuthName "Admin"
AuthUserFile /security/digest
Require user admin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Thanks so much!