#.htaccess located in /foo/bar/baz/.htaccess AuthName "Restricted Area" AuthType Basic AuthUserFile /foo/bar/.htpasswd AuthGroupFile /dev/null require valid-user Options FollowSymLinks AddHandler application/x-httpd-php5 .php RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA] # http://www.foo.bar/foo/bar/baz returns a 404. why? # If I remove the authentication bit it works