I'm running Apache on Ubuntu Server. mysite.com/file.php, for example, is accessible also from mysite.com/file and the same is for images, html pages and everything else. How can I force Apache to serve files only if their extension is specified?

Thanks

link|improve this question
feedback

1 Answer

You need disable MultiViews:

Options -MultiViews

The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.

See these links for details:

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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