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

I have a LAMP server. When user goes to the url, apache automatically decides to render helloworld.php instead of giving a 404 not found error. I don't see any .htaccess file causing the rewrites. I don't see any rewrite rules in the virtual host files. How do I disable this automatic detection of a .php file and provide 404 error instead?

share|improve this question
up vote 5 down vote accepted

What you are seeing is the result of content negotiation. If you haven't, make sure that Multiviews is disabled.

share|improve this answer
In my case it caused 404 exactly then, when a simmilar file was actually present. So e.g. I requested /api/rest and expected this to be rewriten according to rewriting rules. But I got 404 as long there was a file api.php in main directory! Switching off multiviews helped. Thx. – Artur Cichosz Oct 15 '14 at 8:52

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.