Practical mod_perl / HTML Book /



previous page: 4.1.4. Merging <Directory>, <Location>, and <Files> Sections
  
page up: HTML Version of the book
  
next page: 4.1.6. Options Directive Merging

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


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







TOP
previous page: 4.1.4. Merging &lt;Directory&gt;, &lt;Location&gt;, and &lt;Files&gt; Sections
  
page up: HTML Version of the book
  
next page: 4.1.6. Options Directive Merging


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


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

© 2007 StasoSphere.com