[mod_python] Changing the status code with custom content

Michael C. Neel neel at mediapulse.com
Mon Dec 22 11:44:42 EST 2003


I'm having trouble using mod_python to change the status code and have
custom content in the error message.  If I return something other than
apache.OK in my handler, the status line is set correctly set but apache
returns the default error page.  If I have sent custom content for the
error message, the apache error message is added to the end of the
document.  I can get around this by using an ErrorDocument directive in
apache's conf, but I loose access to the traceback of the error and thus
the ability to have a really custom error message.

At first glance this didn't seem to matter.  As long as the content said
error, the user knew of the problem, even if the status was 200 OK.
However I've found out now with search bots this does matter - they
don't know that they have a bad url for the site and are indexing error
pages thinking they are legit.

Any thoughts on what I may be over looking?

Thanks,
Mike



More information about the Mod_python mailing list