[mod_python] Publisher Handler and redirect

Michael Krasnovsky mk at lrn.ru
Thu Aug 15 12:16:48 EST 2002


Hi, Gregory!

Thanks a lot. It works.
I also think that  this case should be described somewhere in FAQ.
Mateusz is right.

Michael.

On Wed, 14 Aug 2002 18:45:57 -0400 (EDT)
"Gregory (Grisha) Trubetskoy" <grisha at modpython.org> wrote:

> 
> 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
> >
> 
> _______________________________________________
> 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