How to disable in Apache access to linux hidden files/folders by default?

guillof

Member
Jul 30, 2014
12
0
1
cPanel Access Level
Root Administrator
So, I've been do it quite a bit or research, and did some tests, but can't find any real solution.


My question is, how can I disable access to hidden linux files (with a dot in front), in Apache, without using htaccess?

I tried adding something like this

<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>

<DirectoryMatch "^\.|\/\.">
Order allow,deny
Deny from all
</DirectoryMatch>


to the three Apache includes, but doesn't seems to works.

Any clue?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
to the three Apache includes, but doesn't seems to works.
Hello :)

Could you elaborate on which specific include files you added these rules to?

Thank you.