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
With rewrite mod:
RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/\. RewriteRule ^(.*)$ - [R=404]
Every file or dir who begin with a dot will be redirected to 404.
/myDir/.svn => 404 /.gitignore => 404 /dir1/dir2/dir3/..../.toHide => 404