I am just curious, how is feature of apache is called that is directing requests like this
www.example.com/index.php/my/path/here
to a file index.php? At the first moment, you might think, that it would be correct if this request leads to 404 error page because there is no folder called index.php at the site root dir.
BTW, is there a possibility to turn off this Apache feature (if it is a feature) so that such requests really end up with 404?
This isn't a URL rewrite feature. Or at least it doesn't need to be. See AcceptPathInfo Directive:
This directive controls whether requests that contain trailing pathname information that follows an actual filename (or non-existent file in an existing directory) will be accepted or rejected. The trailing pathname information can be made available to scripts in the
PATH_INFOenvironment variable.For example, assume the location /test/ points to a directory that contains only the single file
here.html. Then requests for/test/here.html/moreand/test/nothere.html/moreboth collect/moreasPATH_INFO.
It was originally a CGI environment variable.
PATH_INFOThe extra path information, as given by the client. In other words, scripts can be accessed by their virtual pathname, followed by extra information at the end of this path. The extra information is sent as
PATH_INFO. This information should be decoded by the server if it comes from a URL before it is passed to the CGI script.
Refer to this link for an explanation.
It is a method of passing information to the (in this case) index.php script without using a query string, which would be ignored by some search engines, hence the name of the article "Search Engine-Friendly URLs".
I can recommend the third method discussed in the article because it avoids strange looking URLS with index.php in the middle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With