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.