hosting image

How to protect your htaccess file in cpanel?

To protect your htaccess file, we recommend you to block all the unauthorized users to access this file. All you need to follow these steps to access and edit htaccess file.

  • First login to your cpanel account.
  • Now find the “Files” section and click the “File Manager” icon as shown below.

protect your htaccess

  • Now you need to press the “Settings” button when new page is loaded. It will show you a dialog box as in the image given below.

protect your htaccess

  • You need to check the checkbox “Show Hidden files(dot files)”  and press the save button in Dialog box.

protect your htaccess

  • You need to find the File Directory named “.htaccess”.
  • Now you need to enter these commands to your .htaccess file.

(# .htaccess protection)

order allow, deny

deny from all

satisfy all

  • Thanks for reading, to restrict directory access by IP click Here. Or to read about to protect your website images click the link protect images. or to protect a folder by user name and password click here Folder protection. For server solution or web hosting visit