Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a LAMP server. When user goes to the url http://mysite.com/helloworld, 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

1 Answer 1

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 at 8:52

Your Answer

 
discard

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.