How do I match part of a filename using the FilesMatch directive? For example, if I want to match “utilitiesForCurrentPage.js” or customWithOtherCharacters.css, how would I accomplish this? I am currently using the directive(s) below. Assume “utilitiesForCurrentPage.js” is contained in the files folder.
<Directory "/share/apache/files">
...
...
<FilesMatch "^(custom*|utilities*)\.(css|gif|jpg|jpeg|js)$">
Header set Cache-Control "public, max-age=1440, must-revalidate"
</FilesMatch>
</Directory>
You’re missing the
.in your expression (.= match anything except newline):