1. Home
  2. Knowledge Base
  3. Website
  4. Website Tips
  5. How to block access to all hidden files on your account using .htaccess

How to block access to all hidden files on your account using .htaccess

The 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:

+++++
RewriteEngine on
RewriteRule (^\.|/\.) – [F]
++++

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

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support