Knowledgebase

Password protect a directory in cpanel

Within cpanel you will see an icon labeled as "Password Protect Directories" found in the security section, click this and on this page there is a list of all the folders in your home directory.

Find the folder or sub-folder that you wish to add password protection to. Once you have done so, click on the name of the folder (not the folder icon) and this will take you to a new page.

[NOTE: If you click on the yellow folder icon, it will open that folder to show sub folders, allowing you to navigate down to the directory you want to protect, but if you click on the name of a folder, it will then assume that this is the folder you want to password protect and take you straight to the password and user options.]

Now, you will see the following:

Folder requires a password to access via http://
Protected Resource Name:
Username:
Password:

If you wish for all users that attempt to access any of the files in that directory to be required to have a password then click the check box across from Folder requires a password to access via http://

For Protected Resource Name, enter a name for the directory you'll be protecting.

Now, enter the username and password that will be required to access this directory. You can add multiple username/password's if you wish.

Once you have done that, click on the Add New User button and you will be taken to a confirmation page telling you that the directory now has a user added. From now on the only way to access it will be to use the username and password.

[WARNING: If your web site use's a custom .htaccess file, this may be broken as cpanel will write to this .htaccess file at the root level of your web site in order to control password protected directories, so please be sure to backup your .htaccess file first in case it does get over-written and something breaks]



Was this answer helpful?

Also Read
Cron jobs in CPanel (Views: 913)

© WESH UK Web Hosting
Our VAT #: GB 948 8005 93 // All prices are exclusive of VAT