[thelist] custom directory index, aliases

Hassan Schroeder hassan at webtuitive.com
Fri Sep 7 18:39:12 CDT 2001

Sam-I-Am wrote:

> But does anyone know how I'd deal with Aliases? By looking at the usual
> environment variables I can concatenate the document root and the
> request uri, but in the case of aliased directories, this doesn't give
> me the correct path to the requested directory.
> Is there another way? Has anyone done anyting similar?

Uh - have dirindex.cgi read the httpd.conf file entries? A bit of
overhead perhaps, but something like

	$aliasedDirs{$1} = $2 if /^\s*Alias\s+(.+)\s(.+)\s*$/ ;

will make a hash of the aliases, and you only have to do that if an 
open on a dir fails ... then a quick spin through the hash to find
the requested dir, and away you go ...

Then again, there's always symlinks :-)

Hassan Schroeder ----------------------------- hassan at webtuitive.com 
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

    -- creating dynamic Web sites and applications since 1994 --

More information about the thelist mailing list