books
Free Books / Computers / Practical mod_perl /

previous page: 4.1.4. Merging <Directory>, <Location>, and <Files> Sections
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 4.1.6. Options Directive Merging

4.1.5. Subgrouping of <Directory>, <Location>, and <Files> Sections




Description

This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl

Let's say that you want all files to be handled the same way, except for a few of the files in a specific directory and its subdirectories. For example, say you want all the files in /home/httpd/docs to be processed as plain files, but any files ending with .html and .txt to be processed by the content handler of the Apache::Compress module (assuming that you are already running a mod_perl server):

<Directory /home/httpd/docs>
    <FilesMatch "\.(html|txt)$">
        PerlHandler +Apache::Compress
    </FilesMatch>
</Directory>

The + before Apache::Compress tells mod_perl to load the Apache::Compress module before using it, as we will see later.

Using <FilesMatch>, it is possible to embed sections inside other sections to create subgroups that have their own distinct behavior. Alternatively, you could also use a <Files>section inside an .htaccess file.

Note that you can't put <Files> or <FilesMatch>sections inside a <Location>section, but you can put them inside a <Directory>section.

 

Continue to:

  • prev: 4.1.4. Merging <Directory>, <Location>, and <Files> Sections
  • Table of Contents
  • next: 4.1.6. Options Directive Merging

Books by Stas Bekman:















TOP
previous page: 4.1.4. Merging &lt;Directory&gt;, &lt;Location&gt;, and &lt;Files&gt; Sections
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 4.1.6. Options Directive Merging

Topics

  • Animals
  • Architecture
  • Arts
  • Business
  • Computers
  • Crafts
  • Fairy Tales
  • Finance
  • Flora and Plants
  • Cooking
  • Gardening
  • Health and Healing
  • History
  • Home Improvements
  • Languages
  • New Age
  • Novels
  • Real Estate
  • Reference
  • Religion
  • Science
  • Society
  • Sports
  • Travel
  • Outdoors


Search

My Books

Headaches Begone! A Systemic Approach To Healing Your Headaches
Don't Let Your Bike Seat Ruin Your Sex Life Book

Discover

  • Answers FAQ

[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007-2021 StasoSphere.com