httpd-users mailing list archives

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

<http://www.modpython.org/pipermail/mod_python/2002-January/001797.html>

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

AddHandler python-program .py
DirectoryIndex index.py 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.
-Matt


>To: mod_python@modpython.org
>From: Matthew England <mengland@mengland.net>
>Cc: mengland@mengland.net
>Subject: [mod_python] How to hide implementation specifics in URIs/URLs?
>List-Archive: <http://www.modpython.org/pipermail/mod_python/>
>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 
><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?
>
>These references:
>
><http://www.apacheweek.com/features/negotiation>
><http://httpd.apache.org/docs/content-negotiation.html>
>
>...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 <http://myexampledomain.org/tickets/reserve>,
>
>i would like apache to look in the [...]/tickets/ directory for a 
>reserve.* file.  if there exists a [...]/tickets/reserve.py 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"...ie, whatever makes 
><http://192.168.1.50/~mengland/calendar> and 
><http://192.168.1.50/~mengland/calendar.html> do the same thing in my 
>opera.com 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).
>
>
>disclaimer:
>
>I'm constructing a web-database server for ticket reservations and am new 
>to mod_python...and most everything else 
>devshed.com-type-stuff-related.  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,
>-Matt
>
>_______________________________________________
>Mod_python mailing list
>Mod_python@modpython.org
>http://www.modpython.org/mailman/listinfo/mod_python


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message