[mod_python] Redirection from within a handler

Thomas Andrews tandrews at grok.co.za
Thu Oct 7 12:55:13 EDT 2004


Again sorry if this is a totally dumb question.

How does one force a redirect from a handler like
PythonHeaderParserHandler ? I have (working) lines like this:
    req.headers_out.add('Location','http://www.cnn.com')
but that just adds to the header. I can't find a method similar to the
"add" suitable to my needs.

I want to do it from inside a handler because it's a conditional thing -
ie not always redirected, so I can't use httpd.conf

Many thanks,
Thomas



More information about the Mod_python mailing list