加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

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

发布时间:2020-12-13 21:39:01 所属栏目:PHP教程 来源:网络整理
导读:我的apache-conf有什么问题,为什么文件也可以在没有扩展名的文件夹路径下访问?我没有设置任何重写规则,也没有.htaccess文件. 这是默认的os x apache安装. 解决方法 Apache的 content negotiation有一个名为 MultiViews 的选项,它可以在没有扩展名的情况下提
我的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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读