Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apache on the server is set to find index.php by default, and that works for a normal folder.

However, I have a .htaccess rule to route all requests through my routing script:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]

With these .htaccess contents, the server returns a 404 error. Only by specifying /index.php does the routing script get called.

Any tips on what I am doing wrong?

share|improve this question

It sounds like you're not allowing .htaccess files to be used. You need a <Directory> stanza that contains:

AllowOverride All

The option All may not be best for your environment, so take a look at this documentation to see what overrides you will allow in .htaccess.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.