Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Turning off Mason for a subdirectory

by water (Deacon)
on Mar 03, 2005 at 06:19 UTC ( [id://436100]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://436100]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-26 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found