5 ms·
Bah, mod_rewrite is for sissies! Parse the url in your handler code! <Location /dostuff> SetHandler mod_python PythonHandler DoStuff </Location
by snorkel 18y ago
Bah, mod_rewrite is for sissies! Parse the url in your handler code!
<Location /dostuff>
SetHandler mod_python
PythonHandler DoStuff
</Location>
Any request starting with /dostuff gets passed to DoStuff handler and you can parse the url pieces in the handler itself:
from mod_python import apache
def handler(req):
req.content_type = 'text/plain'
print >> req, 'uri = %s' % req.uri
print >> req, 'filename = %s' % req.filename
print >> req, 'path_info = %s' % req.path_info
return apache.OK
- deleted 18y ago[deleted]
- deleted 18y ago[deleted]
- sant0sk1 18y agoor like this: require 'rubygems' require 'sinatra' get '/:name' do "Your name is #{param[:name]}" end