How do I password protect a website folder?
Please note: This support article is a guide for our Linux users only.
The following article explains how to password protect a website folder. When password protection is enabled people will be required to enter a login and password to view the site. This can be done on an individual folder or to the entire website (the htdocs folder).
To password protect a website folder, please follow these steps:
- Open a browser window and go to www.HostMySite.com.
- Click on Control Panel Login.
- Log into the Control Panel as one of the following:
- Account Administrator and select the appropriate domain
- Technical Contact for the domain
- Click on Apache and select Password Protection.
- Select the folder you wish to protect. If you wish to setup password protection for the entire website, select the htdocs folder.
- Click Select Directory.
- Click Ok.
- Enter the necessary information:
- Username: enter the username you wish to use.
- Password: enter the password you wish to use.
- Click Add User.
Once this process is complete 2 files will be created in the folder you protected, a .htaccess file and a .htpasswd file. These files must remain in your directory for the password protection to function properly.