Why adding in the url “/something/watever” after a “page.php” doesn't trigger a 404?

大憨熊 提交于 2019-12-11 14:13:38

问题


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.

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

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.

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).


回答1:


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.



来源:https://stackoverflow.com/questions/57408479/why-adding-in-the-url-something-watever-after-a-page-php-doesnt-trigger-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!