With Apache, I can target files by extension like this:

<FilesMatch "\.(gif|jpg|png|js|css)$">

Can you also target specific files by their entire filename. For example "bg.jpg":

<FilesMatch "bg.jpg">

Would that work?

Thanks, Ben


Should be moved to ServerFault.

Written by joschi

Accepted Answer

Yes, that will work but you need to escape the dot (\.) if you want to use FilesMatch. You could also simply use Files.

Written by joschi
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki