域扩展删除行为

发布于 2024-10-01 18:45:32 字数 284 浏览 3 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只是我以为 2024-10-08 18:45:33

您可能已打开 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

明天过后 2024-10-08 18:45:33

我发现导致此问题的解决方案或原因是 httpd.conf 文件中打开多视图的设置。可以使用以下命令在 .htaccess 文件中禁用此功能。

Options -MultiViews

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.

Options -MultiViews
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文