[mod_python] How to hide implementation specifics in URIs/URLs?

Matthew England mengland at mengland.net
Mon Jan 7 20:40:47 EST 2002


At 1/7/2002 08:08 PM, Rich Salz wrote:
> > <http://www.w3.org/Provider/Style/URI.html>.  Specifically, I'd like to
> > eliminate the references to ".py" in my mod_python-managed URIs.  What are
> > my apache options to do this?
>
>AddHandler python-program .py
>DirectoryIndex index.py index.php index.html

Thanks for the quick response.  This appears to only work if i create a 
subdirectory with index.* files in it.  While this does get me one step 
closer to my goal, it doesn't get me all the way there.  Maybe I'll just 
have to deal with it?

To be a little more specific:

On my server, the URI:

   <http://192.168.1.50/tmp/mptest.py>

prints some arbitrary text in the browser display.

I wanted:

   <http://192.168.1.50/tmp/mptest>

(without the ".py") to do the same thing.  And I want this to work with any 
file in the web-server directory space (or any directory space that i want).

In order to get this to work with the above suggestion, i have to make a 
"mptest" subdirectory and copy mptest.py to mptest/index.py.  Not as 
convenient as i would like for the developers.  Furthermore, my user has to 
include a "/" at the end of the URI in order to ensure relative-link 
reference in the host/domain part of the URI (or at least, that seems to be 
the apparent behavior...something which i don't fully understand 
yet).  Otherwise without the trailing "/" i get a reverse-dns-lookup 
happening that replaces the host-domain part of the URI automatically (at 
least with my apache-server and opera-client).  This is undersire-able for 
my system.

-Matt




More information about the Mod_python mailing list