Okay, so basically I have this htaccess file which prevents images from being hotlinked and cached. However, I do want certain images to be cached (like the ones in the /images directory). So how do I get FilesMatch to work only within a particular directory (in this case, /pics)? Stuff from /images needs to be cached, while stuff from /pics does not.

Code:
<FilesMatch "\.(jpe?g|png|gif|bmp)$">
  Header set Cache-Control: "no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"
</FilesMatch>

RewriteEngine On
RewriteCond &#37;{HTTP_REFERER} !^http://(www\.)?mydomain\.com/$ [NC]
RewriteRule ^pics/.*\.(jpe?g|png|gif|bmp)$ http://mydomain.com/images/nolink.jpg [NC,L]