I run a webserver under Apache with several virtual hosts. I would like to prohobit the access to certain file names, but instead of using a deny rule on each vh I would like to know if I can achieve this with global configuration?
Update
I found the following to suit my needs.
<FilesMatch "myfile.ext">
Require all denied
</FilesMatch>
According to the manual
So in theory setting directives in the main config, if allowed by the context of the directive, should work and be enforced as long as you don't override the directive in either the
<VirtualHost>
section and prohibit.htaccess
overrides.But it is a simple case of testing if things actually work as expected...