I want to disable access to any file OR directory, whose name begins with a DOT. I came up with the following, but it disables access to files/directories beginning with DOT onl
You code does not work because
only applies to the basename of the requested document. That is, the part after the last slash. (source: http://httpd.apache.org/docs/current/mod/core.html#files)
Apache blocks .htaccess
files in a default installation (better: all files starting with .ht
). If you looked closely at the configuration files, you would see something like this:
Order allow,deny
Deny from all
So to hide all files starting with a dot, you would use:
Order allow,deny
Deny from all
In order to make it work for directories starting with a dot, use the following (tested) code:
Order allow,deny
Deny from all