[mod_python] Internal_redirect ?

Miguel Marques miguel at yorku.ca
Tue Jul 31 09:39:07 EST 2001


Greetings...
On Tue, 31 Jul 2001 09:13:26 -0400, Chris Hagner <CHagner at fool.com> wrote:
> If I remember correctly, Grisha stated that this feature has been highly
> requested (and is do-able) but has not yet been implemented.
> 
> Chris
> 
> -----Original Message-----
> From: Bo Lorentsen [mailto:bl at netgroup.dk]
> Sent: Tuesday, July 31, 2001 4:19 AM
> To: mod_python list
> Subject: [mod_python] Internal_redirect ?
> 
> 
> Hi ...
> 
> I have been working on a larger site setup where I like to force a
> redirection to a internal login page if user is unknown (cookie thing).
> 
> The only way of redirection I can find is the one described in the
> mod_python FAQ, but this often gives a small annoying page telling the
> user about a redirection, but what I want is to do it seamless to the
> browser.
> 
> Now in the Apache doc, I found some info. about a function calls
> "internal_redirect", that does exactly what I like to do, but its not
> part of the mod_python API, or I cant find it, at least :-)
> 
> Have anyone a good hint for me at this point ?

With apache I do exactly what you are trying to accomplish by setting
a cookie in req.err_headers_out and returning apache.HTTP_FORBIDDEN.
Then in the apache configuration file you use 
ErrorDocument 403 http://yourloginpage 
in the directory/ies you are trying to protect...
Hope that helps...

						Miguel

C. Miguel Marques, York University, Computing & Network Services
e-mail: miguel at yorku.ca, voice: (416)736-2100x22684, fax: (416)736-5830



More information about the Mod_python mailing list