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.
Add Comment