localhost / test.php也可以在localhost / test /下访问

我的apache-conf有什么问题,为什么文件也可以在没有扩展名的文件夹路径下访问?我没有设置任何重写规则,也没有.htaccess文件.
这是认的os x apache安装.

解决方法

Apache的 content negotiation一个名为 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.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...