Lars Eriksen
downgrade at gmx.org
Fri Nov 24 08:13:23 EST 2006
Excellent, Graham, thank you very much! > Using ErrorDocument directive, it will apply to all URLs falling under the > point where you specify the ErrorDocument directive. > > The second approach is to have your handler return the actual body of the error > response that you want. To do this, the handler would construct a response like > it was doing so for a normal page with the exception that it needs to set > req.status to indicate the error type. Also, if the handler is not the content > handler phase but an earlier phase, the handler must return apache.DONE as the > result rather than apache.OK. Even if the content handler phase, still > preferable to return apache.DONE if the complete response is being returned. > > from mod_python import apache > > def handler(req): > req.status = apache.HTTP_NOT_FOUND > req.content_type = 'text/html' > req.write(...) > return apache.DONE > > Graham
|