perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: Replicating mod_autoindex's behaviour with a modperl handler
Date Wed, 14 Jul 2004 13:01:42 GMT


Rando Christensen wrote:
> Geoffrey Young wrote:
> 
>> see the DirectoryIndex documentation - you can specify a URL as well as
>> individual files, so you can simply point to a mod_perl content
>> handler and
>> leave mod_autoindex/mod_dir to do what they do best.
>>
>> if you use DirectoryIndex then just put
>>
>>   DirectoryIndex index.html /yourhandler/
>>
>> at the topmost level, outside of any vhost directives.
> 
> 
> So, just to make sure I understand what you're saying, I'd do something
> like this:
> 
> <Location /Indexer>
>     SetHandler perl-script
>     PerlHandler Some::Perl::Handler
> </Location>
> 
> DirectoryIndex index.html blah blah /Indexer
> 
> And will that still work when vhosts do stuff like this?:
> 
> <VirtualHost *>
>     <LocationMatch ^/.*\.fake_ext$>
>         SetHandler perl-script
>         PerlHandler blah
>     </LocationMatch>
> </VirtualHost>
> 
> (fake_ext is a fake extension, so there are no real files to correspond.
> I assume all will be well and will be playing with it momentarily, Just
> wanted to see if there's any pitfalls I should know about it)

well, if there are absolutely no real files at all, then I don't think
DirectoryIndex will work - mod_dir only applies DirectoryIndex when
$r->filename ends up being a real directory (a $r->content_type of
DIR_MAGIC_TYPE).  but other than that it looks ok :)

so, if that doesn't work I might try using mod_perl to alter mod_dir's
behavior to set the ct to DIR_MAGIC_TYPE when you need it (over rewriting
mod_autoindex).

HTH

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message