[mod_python] Redirection with the Location Header and publisher handler

Jonathan Gardner jgardn at alumni.washington.edu
Fri Jan 11 07:02:12 EST 2002

On Friday 11 January 2002 05:59 am, Gregory (Grisha) Trubetskoy wrote:
> if you're using the publisher, then something like this should work:
> def myfunc(req):
>  	req.headers_out['Location']="http://blah/blah"
> 	req.status = apache.HTTP_MOVED_TEMPORARILY
>  	return 'You are being redirected to a <a href="http://blah/blah"> new
> location</a>'

1) There's a status attribute? =) I think this should be added to the 

2) I have scoured the 'net for a good explanation of the HTTP error codes, to 
no avail.

It looks like you are saying HTTP_MOVED_TEMPORARILY means "Dear browser, I 
want you to go to this new place instead of here. But next time you get a 
link here, come straight here without delay, do not pass go, and do not 
collect $200."

Conversely, HTTP_MOVED_PERMANENTLY might mean, "Dear browser, how many times 
have I got to tell you you won't find anything here! Stop looking here, go to 
this other place to find what you are looking for."

What is HTTP_TEMPORARY_REDIRECT for? Does it mean the same as 


More information about the Mod_python mailing list