Knowledge Base

Get Expert Website Hosting

Choose website reliability and expertise with SiteGround!

Home / Website Help / Security / How to block access to all hidden files on your account?

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

Last update: Dec 02, 2021

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.

Share this article