perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <jniederber...@comcast.net>
Subject Re: Configuring mod-Perl to handle only some file types
Date Wed, 08 Aug 2012 19:30:09 GMT
Thank you – both Kevin and Ekki 

For my purposes I think Ekki’s idea sounds more like it could work.

Ekki – would you know how to phrase that match in the negative?
In other words, write a regex to match .jpeg, .doc, ....etc. etc.
and if those matches FAIL - then use perl handler?

Thanks again,
Joe N  




From: Ekki Plicht (DF4OR) 
Sent: Wednesday, August 08, 2012 2:23 PM
To: mod_perl list 
Subject: Re: Configuring mod-Perl to handle only some file types




On Wed, Aug 8, 2012 at 8:13 PM, <jniederberger@comcast.net> wrote:

  Hello,

  I have a mod_perl program that is written to handle URL's that
  name either a directory or *.html type files. All other types
  I want Apache to just do its regular thing (e.g., serve image
  type files, or .doc, .pdf, .js, .css, etc.) 
  What's a good way to configure that? So for an entire website directory, and all its substructure,
my perl handler gets only directories
  or  *.html files, and apache handles everything else without
  involing my perl handler.




I just used a <FilesMatch> section in httpd.conf. Like so:
        <FilesMatch "\.(tx|html\...)$">
                SetHandler perl-script
                PerlResponseHandler TxShow
        </FilesMatch>

This match expression filters out any files that either end in .html.?? or .tx.??, the two
?? being language extensions used for auto negotiation.

You can build nearly any kind of Regex there to filter out what you want handled by your mod_perl
script and what should be handled by Apache directly.

Cheers,
Ekki



Mime
View raw message