为什么要在网址中添加"/something/watever"在"page.php"之后不会触发404? [英] Why adding in the url "/something/watever" after a "page.php" doesn't trigger a 404?

查看:107
本文介绍了为什么要在网址中添加"/something/watever"在"page.php"之后不会触发404?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网址为site.com/index.php的网页.奇怪的是,当我在URL中添加/something/whatever(或其他任何内容)并将其设置为site.com/index.php/something/whatever时,index.php页面仍在加载.

I have a webpage with url site.com/index.php. The strange thing is, that when I add /something/whatever (or anything else) to the URL, making it site.com/index.php/something/whatever, the index.php page is still loading.

我不明白为什么服务器不仅仅返回 404 Not Found错误.

I don't get why the server isn't just returning a 404 Not Found error.

我尝试过其他站点,例如php.net.您可以尝试继续 https://www.php.net/manual/en/intro-whatcando.php/

I've tried other site, like php.net. You can try to go on https://www.php.net/manual/en/intro-whatcando.php/,

然后在/之后添加如下内容:

Then add after the / something, like this: https://www.php.net/manual/en/intro-whatcando.php/test/like/test/fuhzefuizh.

我仍然不明白为什么它显示page.php而不是404错误(因为显然,文件夹或URI"fuhzefuizh"不存在).

I still don't get why it's showing the page.php and not a 404 error (because obviously, folder or URI "fuhzefuizh" doesn't exist).

推荐答案

我怀疑这是正常现象,具体取决于服务器配置.这是AcceptPathInfo规则,我们可以使用AcceptPathInfo off将其关闭.

I have foud that it's a normal behaviour depending the server configuration. It's the AcceptPathInfo rule, we can just turn it off with AcceptPathInfo off.

这篇关于为什么要在网址中添加"/something/watever"在"page.php"之后不会触发404?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆