[mod_python] Publisher Handler and redirect

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed Aug 14 18:45:57 EST 2002


Try something like:

 def test(req):
       req.headers_out["Location"] = "http://www.example.com"
       req.status = apache.HTTP_MOVED_TEMPORARILY
       return "Going to Example.com..."



On Wed, 14 Aug 2002, Michael Krasnovsky wrote:

> Hello!
>
> I have a problem. I need redirection inside a publisher handler. I try
> using req.headers_out["Location"] = "http://www.example.com", but it
> doesn't work.
> Here is the example:
>
> def test(req):
> 	"""
> 	"""
> 	req.headers_out["Location"] = "http://www.example.com"
> 	req.send_http_header()
>
> 	return "Going to Example.com..."
>
>
> What's wrong?
> I use the latest mod_python version and 1.3.26 Apache running on Linux.
>
> Thanks.
>
> With best regards,
> Michael.
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list