You can limit access to certain resources of your website by password protecting the directories they are in. When visiting a password protected directory, the user will be prompted for a username and password before they can access the content of the directory.
To password protect a directory:
- Log in to your cPanel account
- Click 'Password Protect Directories' under security
- When prompted, select Web Root and click Go
- You will then be shown a tree view of your directories. Click on the directory you wish to password protect.
- Tick the box labelled 'Password protect this directory' and add a name for the directory. The name field can be anything you wish. This field displays in a popup along with username and password fields when a user visits the protected irectory
- Click Save
- Fill out the Username and password (8 characters max) fields below the section you filled out in step 5 and click 'Add/Modify Authorised user'
Once the above steps are completed, to test that the password protected directory has been set up correctly open a new browser and try to view content within the folder you protected.