How do I block public access to all hidden files?

Add the following lines inside the .htaccess file in the public_html folder:

RewriteEngine on
RewriteRule (^.|/.) - [F]

After adding the above rules, when dot files or folders are accessed, a 403 Forbidden error will be returned.

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.