BACK
Error Redirection

Since built 0.183 it's possible to redirect some errors from the automatic short error message to a static file. Since this feature doesn't make sense for all the errors it is only possible for the reasonable ones. Those are currently "404 - File not found" (path allowed but file not accessable), "403 - Access Forbidden" (path not allowed), "403 - Wrong Referer" (referer checking enabled and either no or not listed referer) and "403/404" for unknown mime-types (empty type string). The files can be of any sort and will be cached in the dynamic file-cache based on the same settings as a normal file would be. It is possible to define different sets of costum messages for every virtual server. Default settings will be copied, an existing error redirection subblock in a virtual server will erase all default settings and after that start to fill the then empty variables with the new values. So you either have no such subblock, or you have to set all the cases it should cover.

The paths can be either absolute or based on the current server work path. It does not use the base path set for the (virtual) server in any form. The http header will also send the error number, not the "200 ok" one. I've tested this with IE6, Opera 7.5 and Firefox without any problems, but older browsers might encounter difficulties to display these pages.

I'd also advise to use images rather than text, especially for the wrong referer case if you try to block illegal access to preserve bandwith for pictures and image based format elements. This way the error will be seen by those loading the perpetrators pages. If you use a gif with very few colors (3+alpha for example) the sizes will be rather small.

  • 403
    example: 403="/home/myhome/errors/err403.html";
    Whenever a request does not pass the allowed path check, the server will reply with a 403 error.

  • 404
    example: 404="/home/myhome/errors/err404.jpg";
    Whenever the path would be allowed, but the specified file is not there, or the server does not have sufficient rights to access it, a 404 error will be sent.

  • referer
    example: referer="/home/myhome/server/pictures/wrong_referer.gif";
    Well, if someone other than the listed allowed sources for a request are encountered, the access is normally blocked with a 403 error with a short text specifying the situation: wrong/missing referer.

  • unknown_mime
    example: referer="/home/myhome/server/pictures/unknown_mime.gif";
    Whenever the file type query results in an empty type string, a 403 or 404 error is generated, blocking the access.


BACK