
August 22nd, 2009, 05:24 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 4
Time spent in forums: 1 h 24 m 32 sec
Reputation Power: 0
|
|
mod_rewrite - Mod_rewrite & HTTP Authentication - Help!
Hi All,
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
Code:
AuthType Digest
AuthName "Admin"
AuthUserFile /security/digest
Require user admin
In the web root, the mod_rewrite is enabled.
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
If I comment out either one, the whole page works correctly. When both are on, I get only 404 Not Found on anything in the /admin directory, but every other directory works great. What am I missing to make them both work together???
Thanks so much!
|