httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew England <>
Subject How to hide implementation specifics in URIs/URLs?
Date Tue, 08 Jan 2002 05:19:32 GMT
I posted the following note to, haven't yet found 
my utopian answer.  There's been several mod_python list followup notes, 
and you can read this thread at:


The best solution i've discovered are these httpd.conf lines:

AddHandler python-program .py
DirectoryIndex index.php index.html

...but as one of my followup note points out, you have to make a separate 
directory for every .py (or any other file) in such a case.  Not quite as 
clean as i'd like.  I'm hoping the apache users can help find an even 
better solution.

The problem is stated below.

>From: Matthew England <>
>Subject: [mod_python] How to hide implementation specifics in URIs/URLs?
>List-Archive: <>
>Date: Mon, 07 Jan 2002 19:43:01 -0600
>I'd like to be able to eliminate any web-server implementation specifics 
>in my URIs/URLs as per 
><>.  Specifically, I'd like to 
>eliminate the references to ".py" in my mod_python-managed URIs.  What are 
>my apache options to do this?
>These references:
>...seem to be more interested in client-side-decision of content 
>negotiation.  while this concept is interesting, and i might use it in the 
>future, i'm not interested in this now.  i simply want to hide the 
>server-side implemenation from my web user.
>here's the basic algorithm i'm looking to implement in apache:
>for said URI <>,
>i would like apache to look in the [...]/tickets/ directory for a 
>reserve.* file.  if there exists a [...]/tickets/ file, then 
>apache immediately throws this .py file at the python handlers.  if there 
>are multiple matches, ie, multiple files with the same 'reserve' but with 
>different extensions, i want apache to decide what to do with the 
>'ambiguous' URI by looking at a prioritized list of "content managers," 
>probably a list specified by me in httpd.conf.  for example, i envision 
>these lines placed in httpd.conf (and this is completely theoretical syntax):
>ContentManager call-the-python-handler .py
>ContentManager call-the-php-handler .php .php3
>ContentManager call-the-cgi-handler .cgi
>The order here is important, for .py files will be displayed/"managed" 
>prior to .php or other files.  In my theoretical behavioral httpd.conf 
>prototype syntax, i would have all unspecified extensions behave as they 
>seem to "out of the box", whatever makes 
><> and 
><> do the same thing in my 
> browser (maybe it's the same mechanism that i describe above?).
>Notice how all of this stuff is totally managed by the server and requires 
>no client-side input from the browser.  As I mentioned before, i'm not 
>trying to have the client-side browser give language or media 
>directives.  My main purpose is to keep my URIs clean and stable so that 
>my users (and therefore much of my web server itself) don't have to change 
>their URLs if i switch to some other underlying technology implementation 
>(say if i switched from python to php for any segments of the web server).
>I'm constructing a web-database server for ticket reservations and am new 
>to mod_python...and most everything else 
>  I find openbsd-postgresql-python-apache 
>to be the most attractive combination that i see now (openbsd for security 
>purposes)...but since I'm new to these technologies, i'm far from certain 
>of things yet.  I therefore apologize for any "newbie annoyance," or for a 
>duplicate question.
>thanks in advance for any help,
>Mod_python mailing list

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message