hakre

msg:3631047 | 6:58 pm on Apr 20, 2008 (gmt 0) |
I'd like to know how to provoke a 404 error in apache as well right now. Currently I'm scanning the docs at htttpd.apache.org to find out more. First I thought mod_rewrite is capable of changing statuscodes but this seems to be for redirects only and 404 is not a redirect code. Where did you start to look for it, which way of research have you thought of?
|
jdMorgan

msg:3631050 | 7:10 pm on Apr 20, 2008 (gmt 0) |
I don't know how to do this with PHP. If you want to 'create' a conditional 404 with mod_rewrite, simply internally-rewrite the request to a non-existent URL-path. Or use the [G] flag on a rule to create a 410-Gone response for HTTP/1.1 clients (and later). Jim [edited by: jdMorgan at 7:11 pm (utc) on April 20, 2008]
|
hakre

msg:3631291 | 5:39 am on Apr 21, 2008 (gmt 0) |
I read about G as well, but that is not 404 it is 410. In my case I'd like to prevent displaying a 403 (forbidden) so that no assumptions can be made about the directory structure. The Idea to rewrite to non-existent files I had thought about as well but some errorpages do display the "true" filename of the file then. The last thing I was working on is to manipulate environment vars sothat apache will display a 404. But I could not proof if this can be done or not.
|
jdMorgan

msg:3631456 | 12:08 pm on Apr 21, 2008 (gmt 0) |
> The Idea to rewrite to non-existent files I had thought about as well but some errorpages do display the "true" filename of the file then. That will only happen if you use an external redirect instead of a internal rewrite, or if you have a server configuration error that causes a redirect to occur on the request. Jim
|
|