域扩展删除行为
我的 php 文件发生了一件奇怪的事情。例如:
domain.com/test.php
domain.com/test
domain.com/test/some/other/directory/that/does/not/exist
上述所有三个链接结构都将在 test.php 文件中解析。这是什么原因造成的? php.ini 文件或 httpd.conf 文件或 .htaccess 文件中是否有设置控制此行为? html 文件不会发生这种情况,只有 php 文件才会发生这种情况。
I have a strange thing happening with php files. As an example:
domain.com/test.php
domain.com/test
domain.com/test/some/other/directory/that/does/not/exist
All three of the above link structures will resolve at the test.php file. What causes this? Is there a setting in the php.ini file or the httpd.conf file or an .htaccess file that has a setting which controls this behavior? This does not happen with html files just php files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能已打开 mod_rewrite 并使用规则来执行此操作。
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
You probably have mod_rewrite turned on with a rule to do that.
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
我发现导致此问题的解决方案或原因是 httpd.conf 文件中打开多视图的设置。可以使用以下命令在 .htaccess 文件中禁用此功能。
The solution or reason that I found that causes this is a setting in the httpd.conf file that turns on multiviews. This can be disabled in an .htaccess file using the following.