Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

localhost/test.php is also reachable under localhost/test/

What is wrong with my apache-conf, why is the file also reachable under a folder-path without an extension? I haven't set any rewrite rules and there are no .htaccess files. This is the default os x apache installation.

like image 380
Dopamine Avatar asked Mar 24 '26 07:03

Dopamine


1 Answers

Apache's content negotiation has an option called MultiViews which makes a file available without its extension:

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.

like image 199
meagar Avatar answered Mar 25 '26 19:03

meagar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!