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.

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
</Files>

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
</FilesMatch>
share|improve this question
add comment

1 Answer

Something like this should work:

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

FilesMatch uses a regex there.

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

Your Answer

 
discard

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.