water has asked for the wisdom of the Perl Monks concerning the following question:

Hi --

I have a Mason site. How can I have Mason not modify pages within a certain subdirectory (eg jusr return the original HTML, no wrapping, no autohandlers, no filters, etc)? Note this subdir is located inside (two levels down) a web tree that is handled by Mason.

I'd prefer to have this "Mason don't change anything" implemented via Mason itself -- some sort of inheritance or override of autoload, but I'm not seeing how to do this-- rather than in the Apache config.

Thanks for help

water

Replies are listed 'Best First'.
Re: Turning off Mason for a subdirectory
by Arunbear (Prior) on Mar 03, 2005 at 11:45 UTC
    This may work if your subdir doesn't already have an autohandler (and assuming mod_perl 1.x)
    %# this is subdir/autohandler <%init> open(my $fh, $m->request_comp->source_file) or return "Could nor open file $!"; $r->send_fd($fh); </%init>
Re: Turning off Mason for a subdirectory
by PodMaster (Abbot) on Mar 03, 2005 at 07:31 UTC
    You need to write an autohandler to do it. You might also need a dhandler.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      I haven't tested yet, but this is the general idea:

      In the directory you want left alone, create an autohandler:

      <%flags> inherit => undef </%flags> <% $m->call_next %>

      Alternatively, you can create an .htaccess file in the desired directory (or <Directory> block in httpd.conf) that has a RemoveHandler directive.