2

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?

1 Answer 1

6

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

1
  • 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. Commented Oct 15, 2014 at 8:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.