问题
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