[mod_python] Mod_python as replacement for mod_rewrite

Klokan Petr Přidal klokan at klokan.cz
Wed Dec 20 03:13:18 EST 2006


Hello,

I need to make an intelligent replacement for mod_rewrite, so it will
count url using quite complicated math a then forward request to
fast-cgi server...
In fact I'm going to use it for WMS (Web Map Service) emulation over
IIPImage (imageserver),
so url like:

http://domain/script/?WMTVER=1.0.0&REQUEST=map&LAYERS=RELIEF&STYLES=default&SRS=EPSG:4326&BBOX=-2.197265625,39.55078125,20.302734375,50.80078125&WIDTH=256&HEIGHT=128&FORMAT=JPG

will be redirected (as fast as possible and internally inside apache)
to fast cgi request

http://domain/fastcgi-bin/iipsrv.fcgi?FIF=/tmp/test.tif&WID=256&HEI=128&RGN=0.25,0.25,0.5,0.5&CVT=JPEG

where I have to transform lat/lon numbers in first url to region on
the image in the second url... but this wouldn't be so big problem in
python...

Question is which apache handlers use to make this internal forward,
and how to make that as fast as possible...

Is mod_python the right tool for this task?

Or do you think it would be better to hack directly mod_rewrite and
programm the transition of coordinates in C?

Thanks a lot for any help...

Klokan


More information about the Mod_python mailing list