Say I have a file “index.php”. And I access it just fine (e.g. “http://www.domain.tld/index.php“) and nothing’s wrong with it. Now say some bozo tries to get cute with the URL, appending another file/directory to it (e.g. “http://www.domain.tld/index.php/another/file“). My server attempts to serve whatever it thinks that URL requests, which results in a horrible-looking page since all of my relative links and sources then point to the invalid directory (in this example: “http://www.domain.tld/index.php/another/“, so if I want “index.css”, the browser requests “http://www.domain.tld/index.php/another/index.css“, which doesn’t exist). What settings would I have to change to cause a request like this to return an error?
I’ve posted this in the PHP forum because I tested this behavior with a normal “htm” file and received a 404 Error.
@palswimauthorMar 27.2007 — #My main server isn't my own, so I'm not sure there. I checked the httpd.conf file on my testing servers and didn't have mod_rewrite loaded and everything else referencing php is just the normal stuff.
@NogDogMar 27.2007 — #I don't know enough about webserver processing to have any idea why such URIs do not also just result in a 404 Not Found. Only thing I have to suggest until some expert comes up with an explanation (and hopefully solution) is to add a BASE element to the page's HEAD section, so that the browser knows from where relative links should be resolved: <i> </i><head> ... <base href="http://www.domain.tld/index.php"> ... </head>