Hi!

On Mon, Sep 08, 2003 at 04:51:55PM +0100, Steve Hay wrote:

> The project is going to be written as a series of mod_perl handlers - 
> one for the main "home page", and others for various sub-components.  
> Each handler is implemented by a separate module (all sub-classes of a 
> common base class).  I don't want to have to configure a separate 
> Location for each sub-component.

You might want to take a look at Apache::Dispatch, which does exactly this.

> <Location /myproject>
>    SetHandler perl-script
>    PerlHandler MyProject->dispatcher
> </Location>
> 
> <LocationMatch "^/myproject/(images|javascript|stylesheets)">
>    SetHandler default-handler
> </LocationMatch>

I'm using something like this with Apache::Dispatch

PerlModule Apache::Dispatch
DispatchUpperCase On       # this is /not/ in Apache::Dispatch, 
                           # only in my patched version
DispatchPrefix Oe1
DispatchExtras Error

<Location /myproject>
   SetHandler perl-script
   PerlHandler Apache::Dispatch
</Location>
                           
<Location /myproject/css>
   SetHandler default
</Location>
<Location /myproject/img>
   SetHandler default
</Location>

This is working as expected, i.e. request for /css/foo.css or /img/bar.png
are not handled by Apache::Dispatch



-- 
#!/usr/bin/perl                               http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Reply via email to