Forum Moderators: coopster
For example:
Correct url: http://www.example.com/about.php
User enters:
http://www.example.com/about.php/
or
http://www.example.com/about.php//
or
http://www.example.com/about.php///////
I don't think it causes any breach in security... just curious why this doesn't behave as a 404. Very peculiar.
Thanks!
[edited by: encyclo at 10:45 pm (utc) on July 8, 2009]
[edit reason] switched to example.com [/edit]
just curious why this doesn't behave as a 404.
I think . . . it should. I just tested three sites with trailing slashes after the file name. Andrew's case is a little different, see below.
Samples, FireFox Live headers says:
GET /index.html/// HTTP/1.1
HTTP/1.x 404 Not Found
GET /dfgdfg.php/ HTTP/1.1
HTTP/1.x 404 Not Found
GET /cgi-bin/blah.cgi// HTTP/1.1
HTTP/1.x 200 404 Not Found
All three of these sites use dynamic output for HTML, and have .htaccess directives for non-files/directories (if !-d and if !-f) so they output custom pages based on the results. The headers are still 404's.
The problem is/should be that file.php/// is the requested filename, since it doesn't exist, it's a 404. So I'm casting my vote for something goofy in your server configuration, either via the configuration or an incorrect .htaccess directive.
In andrew's case he is referencing a directory, which is different and my guess is that's still a server configuration, either by design or by error. It's apples and oranges. When you request
/domain/directory
Directory indexing comes into play; if directory indexing is off and there's no index.html in /directory, what you should get is "permission denied." I just tested this also on other servers, response to the presence or absence of the trailing slash for a directory depends on the server configuration. For example, I may intentionally not have a directory "directory" but in my .htaccess file create a rule that if /directory (or /directory/) is requested it is rewritten to a script to look up "directory" in a database.
I'm guessing the example shown for this web site is a server configuration, whether it's by design or error only Brett will know.
Welcome aboard understory, see TOS #13 . . . .
So I'm casting my vote for something goofy in your server configuration, either via the configuration or an incorrect .htaccess directive.
I'll try playing with my htaccess and see what happens... I'm not really worried about users visiting the site and going to index.php/ or index.php///. I'm just curious why things are behaving the way they are.
I've actually tried whatever.php/ on a couple different sites, and the following has happened:
1. 404
2. redirect
3. the page remains the same
4. the page remains the same with some content missing
Thanks very much for your responses!