Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.