Htaccess - rewrite mod

So here is what I have in my .htaccess. I’m trying to write a front controller/dispatcher. The problem is, the information contained at has the the code, but if a file or directory exists (because of the !-f and !-d if I’m not mistaken), it shows that file/directory. I’d like to make it so any url entered is sent to the dispatcher, even if it exists.

Here’s what im trying.


#ErrorDocument 403 /mafia/errors/403.php
#ErrorDocument 404 /mafia/errors/404.php

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

Options -Indexes +FollowSymLinks
RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mafia/index.php [L]

When I go to the home page, I get the home page with the CSS not working. When I go to any subfolder (existent or not) it gives me a 500 error. I was hoping someone could help me out with this. If I uncomment the two RewriteCond’s, it works fine, except then if someone goes to a folder or file that exists, it opens it. I’m hoping to avoid this.

You forgot to exclude recursion.

:cool: -//-

How do I do that?

Uh, make sure the URL is not /mafia/index.php already. Otherwise you’ll get… recursion!

:cool: -//-