There was a problem loading the comments.

How to restrict access to your site using .htaccess?

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
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“.
e7cdf0c6987ead60bd0c85a93ae1c3ae11f82302?t=fe8cd9b1f4e7b1ce048f8dafd506146e
4. Mark „Show hidden settings (dotfiles)“.
5a6b31ec5dc3995dc6024cd2ae0760f19e499c09?t=c8296a475dce3b6a8930c6794a6647c1
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“.
b4f7c2677b19ef9162b1a59802cb5d6d5a52aa73?t=7f4f6bc3a356fb9a75c70e5de3582cf0
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:
be7420251f4a7904c3fb9c2665e346a019f14acb?t=a18af25eff0b83975affd0e4ce588e3f
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


Comments

Add Comment

Replying to  

Captcha
© Getspace - EU