Password protect your website

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.

If you want to perform a more advanced type of password protection where you have a members area of your website that users can access, we recommend you contact your web developer as this will require some PHP, ASP.NET, Perl or Javascript coding knowledge that the below tutorial is not able to cover.

Password protect a directory on cPanel

Password protecting a directory in cPanel is quite easy. Follow the steps below for instructions.

  1. Log into cPanel
  2. Click the Password Protect Directories icon
  3. Click [Go]
  4. Select the directory you wish to password protect
  5. Fill in the required information
  6. 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.

  1. Create a .htpasswd file
  2. Create a .htaccess file
  3. 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.

  1. Log into your Account
  2. Manage the domain you want to make changes to
  3. Click Cloud Hosting
  4. Scroll down to see your FTP details
  5. Copy the path displayed in the Path column
    This path is the path to your root directory.
    eg. /clientdata/server-name/x/y/domain.tld/www/
  6. When including the path to the .htpasswd file, you must include the .htpasswd file name and it's location in the code
    eg. /clientdata/server-name/x/y/domain.tld/www/.htpasswd