[mod_python] TransHandler help?

Alan Kennedy modpython at xhaus.com
Mon Jan 7 23:18:34 EST 2002


Thanks Olly,

It's good to know that I'm not the only who can't get it to work :-\

I've been avoiding relying on mod_rewrite and its "cool voodoo". I have the training and
background to get my head around it, but members of my team unfortunately don't, whereas
they are all very comfortable with python.......

Thanks for the reply,

Cheers,

Alan.

Oliver Cope wrote:

> On Mon, Jan 07, 2002 at 07:32:10PM +0000, Alan Kennedy wrote:
> >
> > I'm trying to get a PythonTransHandler working.
> >
> <snip>
>
> > *without* sending a redirect back to the client. Or a more sophisticated
> > example, how could I turn a request for
> >
> > /admin/abc1234/update/item4567
> >
> > into a request for
> >
> > /admin/doit.html?sessionID=abc1234&command=update&what=item4567
> >
> I too have spent some time trying to configure a PythonTransHandler, but
> couldn't get it to work :o(
>
> I've had more luck using mod_rewrite for this kind of thing:
>
> RewriteEngine On
> RewriteRule /admin/(.*)/(.*)/(.*) /admin/doit.html?sessionID=$1&command=$2&what=$3 [PT]
>
> This will rewrite requests without sending redirects back to the client.
> You can remove the '[PT]' if you don't need to further process the
> rewritten URL (e.g. through a PythonHandler).
>
> Obviously regular expressions are not as flexible as a Python
> handler can be, so this will only work for simple translations.  Also
> you'll need to have Apache compiled with mod_rewrite, I'm not sure if
> this is the default.
>
> Regards,
>
> Olly.
>
> _______________________________________________
> 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