Fw: Re: [mod_python] Publisher Handler and redirect

Ian Clelland ian at veryfresh.com
Fri Aug 16 01:08:18 EST 2002


On Thu, Aug 15, 2002 at 01:10:18PM +0200, Michael Krasnovsky wrote:
> Missing req.status set to mod_python.apache.HTTP_*_REDIRECT
>  
> def redirect(req):
> 	req.status = mod_python.apache.HTTP_TEMPORARY_REDIRECT
> 	req.headers_out["Location"] = "http://www.ant.gliwice.pl"
> 	req.send_http_header()
> 
> 
> P.S. This should go to FAQ ;)

Your first line should probably be something like this:

  req.status = req.proto_num >= 1001 and \
      mod_python.apache.HTTP_TEMPORARY_REDIRECT or \
      mod_python.apache.HTTP_MOVED_TEMPORARILY

since older clients (Pre-HTTP/1.1) won't understand the
HTTP_TEMPORARY_REDIRECT status code.

--
Ian Clelland
<ian at veryfresh.com>



More information about the Mod_python mailing list