Is it possible to use a wildcard (*) in the tag of .htaccess?

Is it possible to use a wildcard (*) in the  tag of .htaccess?

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>

Now is it possible to use a wildcard in the filename? I would like to deny access to all system files (.* - any file that it's filename starts with a dot). I would like to know if the following would work for what I want:

<Files .*>
order allow,deny
deny from all
</Files>

答案1

What you need there is FilesMatch:

<FilesMatch "^\.">
    [config]
</FilesMatch>

(The pattern is a regexp, rather than a glob, though).

More Info here

相关内容