I would like to deny access to multiple files with exactly name. So I tried with no success:
<Files config.inc.php config_smtp.inc.php>
Order allow,deny
Deny from all
</Files>
I cannot use FilesMatch because I want to deny files with exactly name.
Best Answer
FilesMatch
is precisely what you can use. For example:In this case the regex could be shortened a bit, eg.
^config(_smtp)?\.inc\.php$
to match the same two files as above.Note that since you're on Apache 2.4, you should be using mod_authz_host instead. For example: