There was a problem loading the comments.

How to restrict access to your site using .htaccess?

Support Portal  »  Knowledgebase  »  Viewing Article

How to restrict access to your site using .htaccess?

To prevent direct access to all files and folders on your server, at first you need to find .htaacess file.

1. Login into your cPanel account.

2. Click on „File manager“ in the „File“ section

3. In the right top click on „Settings“.
4. Mark „Show hidden settings (dotfiles)“.
5. Find the .htaacess file, default directory, that is home/public_html folder, but it may differ depending on the settings. When you found the file click on it with the right mouse button and choose „Edit“.
6. Now, let’s place the deny from all command in the .htaccess file. Add the following code snippet to the top of the file if you want to block all access:
7. Click on „Save Changes“.

Note: To remove restrictions, just delete the rule line from document and save the changes.

Share via
Did you find this article useful?  

Related Articles


Add Comment

Replying to  

© Getspace - EU