Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

For poorly configured Apache servers you can have to do something like this to deny access to the .htaccess file:

<Files .htaccess>
order allow,deny
deny from all

I would like to deny access to all system files (.* - any file that it's filename starts with a dot). I know it's possible with FilesMatch...

Something like this (but working):

<FilesMatch .*>
order allow,deny
deny from all
share|improve this question

Something like this should work:

<FilesMatch "^\.(.*)$">
   order allow,deny
   deny from all

FilesMatch uses a regex there.

share|improve this answer
just ... do not forget the closing " :) – LazyOne Jul 21 '11 at 23:41
@LazyOne: right, fixed ;) – Marco Bizzarri Jul 22 '11 at 3:11

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.