perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <>
Subject Re: hiding the technology behind static URLs
Date Mon, 19 May 2003 16:35:21 GMT
On Mon, 2003-05-19 at 09:23, Randal L. Schwartz wrote:
> They've suggested to me a file structure that looks like:
>         /pw/ - all password protected items
>         /pw/cgi - mod_cgi (most existing things here)
>         /pw/static - static html and images here
>         /pw/registry - Apache::Registry (many CGI migrate here)
>         /pw/template - Apache::Template (many HTML migrate to here)
>         /public/ - same as above, no password
>         /public/cgi/ - mod_cgi, no password
>         /public/ ... etc ...

I wouldn't put /pw/ in the URLs, unless there is no other way to
organize things that allows the protected content to be identified.  An
access handler can be attached to any directory or URI, so technically
it is not necessary to put all protected content in one place.

> I'm thinking of a PerlTransHandler that has either
> (a) a search list with a cache per process (and maybe a timeout) or
> (b) a huge static hash of THIS url maps to THAT resource

We had a lot of pages at eToys that used static-looking URLs.  The
approach we used was to map directories to different handlers (you can
do this with Registry by setting up a script to be the index for a
directory or using a transhandler to map to a script), and then let the
handler decide which template it wants based on path_info.  Typically a
URL would look something like this:


The 12345 part would be an ID to the resource we want to display, and
the application would use that to figure out which template to grab. 
For example, the app might look up a product based on this ID, find that
it's a book, and pull the name of the book template file from the app's

> Also, should I return DECLINED?


> And /appname/$unique_value might not be enough for the entire app.
> What if I need to add subdirs for this?

Why wouldn't you use the whole URI?

- Perrin

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message