Knowledgebase: cPanel/WHM/Linux
Password Protect A Directory
Posted by - NA - on 03 March 2007 02:28 PM

To password protect a website or folder, you will need to have access to your hosting control panel.

Linux with cPanel

Use the Password Protect Directories icon in cPanel. We have an updated blog article with detailed steps and screenshots at

Windows with ASP

Use the Secure Folders option in WebSitePanel Website Properties. We have an updated blog article with detailed steps and screenshots at

(142 vote(s))
Not helpful

Comments (16)
05 January 2011 02:48 AM
Excuse me! But where is 'Password Protect Directories'?!?!?
Arvand Sabetian
06 January 2011 09:00 PM
You may want to search for it inside your control panel using th search box. Simply type in "Password Protected Directories". Do note however that this is only for linux accounts and the cPanel control panel. On Windows/WebSitePanel, please use the secured folders tab underneath each websites under the Websites section.
Bill Powers
01 May 2011 06:18 PM
How do I unprotect a directory in Linux/cPanel?
I have already removed the users which had access.
Arvand Sabetian
02 June 2011 11:29 PM
Uncheck the box under the protection of that directory.
30 September 2011 10:34 AM
When I try to password protect the directory, I set it up according to the directions given. Do I need to do anything in the IIS manager - remote? I'm getting a 401 error when I try to access the resource in the protected folder
Ryan C
18 October 2011 07:10 AM
This only applies to Linux hosting. IIS would mean Windows and I would suggest checking out the secure folders tab (

If you still face issues, please do not hesitate to submit a support ticket.
04 March 2012 07:10 PM
When I password protect a directory, I get a 404 error from WordPress, rather than a prompt to log in. How can I password protect a folder and be prompted for a log in with WordPress installed?
Michael Carr
12 May 2012 06:12 PM
There is an issue with your password protection. if you can contact our support, we will be happy to take a look for you.
04 March 2012 07:38 PM
I've found that for WordPress installs in the root with Permalink, you must put these lines at the beginning of the root htaccess file when password protecting a directory, otherwise WordPress returns a 404 error:

# To bypass protected directory
ErrorDocument 401 /%{REQUEST_URI}/myerror.html
ErrorDocument 403 /%{REQUEST_URI}/myerror.html

Chris Brown
05 March 2012 02:07 PM
I am having difficulty password-protecting a directory. I'm specifically unsure about the instruction, "In order to enable password protection on a directory, you will need to first check the box at the top of the page." I have created the directory, but I don't know at the top of what page I should be looking for a checkbox (knowing how it is labeled might help me find it).
Michael Carr
18 March 2012 06:02 PM
The instructions indicate that you would first need to click on the tool labeled "password protect directories" and then click on the directory that you want to enable protection on. Then at the top of the resulting page you can click on the checkbox. Keep in mind that these instructions are for linux based cPanel account only. I am going to update them now to make that a bit more clear.
Jerry Barrax
13 November 2014 06:01 AM
I have setup a password protected directory and added files to it. When I access the root directory using Firefox, the username and password prompt comes up. But when I try to access any of the files in that same folder, I get an Access Denied and 404 error.
This even happens if I move one of the files from that folder into a non-protected folder. The same error is generated. How do I fix this?
Michael Carr
28 November 2014 11:50 AM
There could be several things at work here, Please open a support ticket and we ill be happy to take a look for you.
Christine Slagle
26 April 2015 07:47 AM
I am on a linux account and I am using the Arvixe Builder to build my site. Is there a way to add a password to some of my pages to limit who may view them? Thanks.
Ryan C
11 May 2015 11:14 PM
I encourage you to check out
Christine Slagle
26 April 2015 07:52 AM
I am on a Linux account and I am using the Arvixe Builder to build my site. Is there a way to add a password to some of my pages to limit who may view them? Thanks.
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).