How to block access to all hidden files on your account?

Files or folders starting with a dot are usually Linux system files. For Security precautions it is recommended to disable all direct web access to them.

To do this, you can add the following lines inside the .htaccess file in the public_html folder:


After adding these rules, anyone who tries to access dot files or folders will receive a 403 Forbidden error.

If there is no .htaccess file in the public_html folder, you can create it from cPanel -> File Manager, via FTP or SSH.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!