Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2008
    Posts
    214
    Thanks
    5
    Thanked 22 Times in 22 Posts

    Question Help with regexp in <Files> tag of .htaccess

    For poorly configured Apache servers you can have to do something like this to deny access to the .htaccess file:
    Code:
    <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 ):

    Code:
    <FilesMatch .*>
    order allow,deny
    deny from all
    </FilesMatch>
    Last edited by AlexV; 07-21-2011 at 07:15 PM.

  • #2
    Regular Coder
    Join Date
    Oct 2008
    Posts
    214
    Thanks
    5
    Thanked 22 Times in 22 Posts
    Found the solution:

    Code:
    <FilesMatch "^\.">
    order allow,deny
    deny from all
    </FilesMatch>


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •