There are several ways to password protect a specific page, directory or area of a website. Password protecting a website typically requires some basic coding language knowledge, however there are some basic ways to password protect a website directory without needing any programming skills. If you want to password protect a specific directory that you've uploaded to our servers you may do so using the .htaccess method of password protecting a directory. Instructions on how to do this are outlined below.
Password protect a directory on cPanel
Password protecting a directory in cPanel is quite easy. Follow the steps below for instructions.
- Log into cPanel
- Click the Password Protect Directories icon
- Click [Go]
- Select the directory you wish to password protect
- Fill in the required information
- Click [Add/modify authorized user]
Password protect a directory on Cloud Hosting
To password protect a directory on our Cloud Hosting server environment, users must create some files manually and upload them to our servers. The steps are as follows.
- Create a .htpasswd file
- Create a .htaccess file
- Upload both files to the server via FTP
Place the .htaccess file in the directory you want to password protect
Create a folder called mypasswords in the server root directory
Place the .htpasswd file in the mypasswords directory
Determine the path to your root directory
The create a .htaccess file tool available at the URL above asks users to provide the path to their .htpasswd file, Cloud Hosting customers can determine the path to their root website directory by following the steps below.
- Log into your Account
- Manage the domain you want to make changes to
- Click Cloud Hosting
- Scroll down to see your FTP details
- Copy the path displayed in the Path column
This path is the path to your root directory.
- When including the path to the .htpasswd file, you must include the .htpasswd file name and it's location in the code