I need to make browser caching with htaccess file.
From this question I found out how to add extensions to htaccess file.
<FilesMatch "\.(js|jpeg|jpg)$">
But I need to add extensions. But exclude some of the files.
I found something like this from this question
<FilesMatch ^((myfile|myfile2)\.js$|myphoto\.jpe?g)$>
Add all js and jpeg files except "myfile.js", "myfile2.js", "myphoto.jpg" How can I do this? Thank you
Try this
This will match all
js
andjpeg
files exceptmyfile.js
,myfile2.js
, andmyphoto.jpeg
using negative lookahead/lookbehind. Kind of ugly but I couldn't find a nice way to do this.You can then have a separate files match for only those files and set a different header: