Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I put this in httpd.conf

Reloaded apache.

<FilesMatch "\.(gif|jpe?g|png)$">
  Order allow,deny
  Deny from all

I'm expecting no files to be accessible from browser except image files, but I can access no probs test.php

what am I doing wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You've got it backwards. That config denies access to all image files and allows access to all other files.

You can create negative regular expressions to do what you want or you can change the order (and hence logic) of your allow,deny directives.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.