[mod_python] Getting query parameters when there is RewriteRule

sliderw hotmail sliderw at hotmail.com
Wed Apr 25 22:51:20 EDT 2007


In httpd.conf, I have:

RewriteRule ^/dl/([^/\?]+)/([^/\?]+)/? /dl/myhandler.py?a=$1&b=$2 [PT,L]

and:

Alias /dl/ "/some/path/"
<Directory "/some/path/">
  ... mod_python stuff here for myhandler ...
</Directory>

myhandler gets the query parameters using qp = 
req.parsed_uri[apache.URI_QUERY]. If I go to 
http://www.mysite.com/dl/myhandler.py?a=1&b=2, qp is "a=1&b=2", as expected. 
On the other hand, if I go to http://www.mysite.com/dl/1/2/, qp is None, but 
I expect qp is "a=1&b=2". How can I make this work?

I'm using mod_python 3.3.1.

Thanks.

_________________________________________________________________
The average US Credit Score is 675. The cost to see yours: $0 by Experian. 
http://www.freecreditreport.com/pm/default.aspx?sc=660600&bcd=EMAILFOOTERAVERAGE



More information about the Mod_python mailing list