[mod_python] Long URIs and Path Info

Graham Dumpleton grahamd at dscpl.com.au
Mon Nov 27 16:12:08 EST 2006


Derek Asleson wrote ..
> I've been trying to figure out how to make long URIs with mod_python for
> a
> few days now. I don't want an extension (I've figured out how to have long
> URIs with AddHandler, but this shows an extension), but I want my URIs
> to/look/like/this. Here's more examples of the effect I am going for:
> 
> {index directory}/about/biography
> {index directory}/blog/post/10-23-2007
> 
> I know I with publisher you can have this effect ({index directory}/about)
> but I could not figure out how to add deeper URIs. Any ideas?

Are you using your own mod_python handler or are you using publisher?
What you are using in part dictates what you can do.

Even when using AddHandler, it is possible to avoid the need for an
extension in the URI if you set Apache up correctly for use of MultiViews.
Some details are contained in:

  http://www.dscpl.com.au/wiki/ModPython/Articles/SetHandlerVersusAddHandler

This can apply to publisher but also custom handlers.

If using publisher, one can use a trick to allow additional path information
to be processed using special wrapper classes around published functions.
I posted about this on the mailing list a long time back. I haven't read
through the post again and assume it is still valid, although more than
likely I am sure to do it a different way these days. See:

  http://www.modpython.org/pipermail/mod_python/2005-March/017560.html

Graham


More information about the Mod_python mailing list