Quantcast
Viewing latest article 22
Browse Latest Browse All 33

Apache 2: Negative FilesMatch / FilesNotMatch

If I want to apply a rule to only some files in apache2.conf, I can use <FilesMatch>.

For example:

<FilesMatch ".(gif|jpg|jpeg|png|mpg|avi)$">    deny from env=hotlink</FilesMatch>

But is there a opposite to FilesMatch, i.e. a FilesNotMatch?

What I want to achieve is:

<FilesMatch ".(gif|jpg|jpeg|png|mpg|avi)$"><FilesNotMatch "ban">        deny from env=hotlink</FilesNotMatch></FilesMatch>

(deny hotlinking of all images on a server BUT banners)

Or do you have a suggestion how I could modify my regexp to not match anything that contains "ban" ?


Viewing latest article 22
Browse Latest Browse All 33

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>