Search  
   
Browse by Category
 
Netfirms 24/7 Support .: SITE: DESIGN, PUBLISHING & FTP .: E. Securing Your Website .: How do I password-protect a folder on my website?

How do I password-protect a folder on my website?

Password-protection of a portion of your website is accomplished by placing all the files you wish to password-protect under a common folder. For instance, if you allow registration on your website and you would like to allow members to login to a protected area, create a folder called members. Then place all member-related files under the members folder. The final step is to password protect the members folder.

I. Method #1: Access the Password Protect tool from the Netfirms Control Panel:

1. Login to the Netfirms Members Control Panel at https://controlpanel.netfirms.com

2. Click Hosting 
3. Choose Files
4. Click Protected Directories
5. In the Path text box, enter the full path to the directory you wish to password protect
6. In the Username and Password text boxes, enter the username and password that will be used to authenticate the visitor to the protected directory

NOTE #1: The folder you wish to protect must reside within /www and should not contain any spaces in the folder name. If you haven't created the folder yet, please do so in order for the password-protection to enabled on the folder you specified.

NOTE#2: If your visitors will be accessing the password-protected folder via a domain that is being forwarded to a subfolder on your hosting account, please also password-protect the root folder.

Eg. If you want to protect /www/subfolder/protectedFolder

and if:

domain2.com -> domain1.com/subfolder

then you will be required to configure password protection for both

/subfolder/protectedFolder

as well as:

/protectedFolder

7. Click Add

NOTE: It may take up to 10 minutes for the new logins to take effect. Please write down all usernames and passwords you create. If you subsequently lose or forget the password to a username, you must delete the username and recreate it with a new password. Currently there is no method to recover lost or forgotten passwords through this tool.

II. Method 2: Password Protection Using .htaccess

1. Create a .htaccess and .htpasswd file in the directory you would like to password protect.  If you are unsure of how to create a file, please click here.
2. Browse to: 
http://www.tools.dynamicdrive.com/password/ (This site will encrypt your password and create the .htaccess code).
(a) Under "usernames" input a username (eg: admin)
(b) Under "passwords" input a password (eg: password)
(c) Under the "Path to .htpasswd file:" you must input the root directory for your domain followed by the directory you wish to password protect.  To find the root directory for your account, please click here. 
(d) Once you have inputed all of the information, click the Submit button.
(e) The information that this application generates will be the htaccess directives for the .htaccess file as well as the password file which contains the username and encrypted password. Copy and paste the information into the .htaccess and .htpasswd files on your account.


How helpful was this article to you?


.: Powered by Lore 1.5.6
Visit Netfirms.com Web Hosting | Copyright © 1998 - 2009 Netfirms, Inc. All Rights Reserved.