What could cause this rules to fail?


Trying to configure a ZF application.

.htaccess is pretty straight-forward:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ [NC,L]
RewriteRule ^.*$ index.php [NC,L]
php_flag magic_quotes_gpc off
php_flag register_globals off

I always get a 500 error. Commenting out lines didn’t help me with finding where exactly the error occurs.

I’m at a loss of ideas.


First thought is that there is a syntax error. Since a RewriteRule REQUIRES both regex and redirection, that’s likely your problem (first RewriteRule).

Second, I can’t believe that you can comment out the entire .htaccess and you’re still getting a 500 error so there may be something else in play other than your .htaccess (somewhere else on the server). I think you should comment out every line (#) then remove, one at a time starting with the php_flag directives first, then RewriteEngine on and the first rule set and, finally, the last RewriteRule. At least that’s what I would do.