[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: DirectoryIndex ignored when using perl-handler
From:       Geoffrey Young <geoff () modperlcookbook ! org>
Date:       2005-04-27 15:39:19
Message-ID: 426FB227.20608 () modperlcookbook ! org
[Download RAW message or body]


for the sake of the archives, william reported that the below fixup handler
is "working like a champ" so I guess this is a workable solution for anyone
in the same situation.

and for anyone listening, rolling up a test tarball like william did was
outstanding - I was more than happy (ecstatic, actually) to spend the 10
minutes it took me to code the proper handler when all I needed to do was
run 'make test' and see _exactly_ what he saw as the problem and what he
expected to see when all was working properly.

so, thanks william :)

--Geoff


> the below code used as the only fixup
> handler should do the trick.
> 
> HTH
> 
> --Geoff
> 
> package My::Fixup;
> 
> use strict;
> use warnings FATAL => qw(all);
> 
> use Apache2::Const -compile => qw(DIR_MAGIC_TYPE OK DECLINED);
> use Apache2::RequestRec;
> 
> sub handler {
> 
>   my $r = shift;
> 
>   if ($r->handler eq 'perl-script' &&
>       -d $r->filename              &&
>       $r->is_initial_req)
>   {
>     $r->handler(Apache2::Const::DIR_MAGIC_TYPE);
> 
>     return Apache2::Const::OK;
>   }
> 
>   return Apache2::Const::DECLINED;
> }
> 
> 1;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic