1

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>
Activist
  • 23
  • 1
  • 3

2 Answers2

3

Something like this should work:

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

FilesMatch uses a regex there.

Marco Bizzarri
  • 1,358
  • 1
  • 11
  • 11
0

Goodnight, If I want to block access to domain/path/?xxxx (xxxx is variable), but allow access to domain/path/, how should I write it in my .htaccess?

Sanata
  • 11
  • 3