Having a domain means you can share many things with the world. But sometimes you don’t want the world to see everything. Your cpanel provides a tool that can put a username/password lock on any directory in your site files.
Before adding a password, the Mad Scientists at Extend Labs need to put something on their web site to protect. Returning to what they learned earlier for using the File Manager to add a set of web files, from within their cpanel, they open the File Manager.
They remember that the
public_html directory contains all content that shows up at their main domain url
extendlabs.ca and that they already have a directory in there named
stuff, Navigating to that directory, they create a new folder within there called
dropped intended for some files they want to store but keep under password protection. They upload a few files, an image, a PDF, and an mp3 audio file.
For now, anyone can see these files via the URL
Now the Mad Scientists are ready to put a lock and key on that URL. From their cpanel, in the Files group, they open Directory Privacy. This reveals a list of all directories in their domain.
Clicking the folder icon next to
public_html opens a list of directories in there, they once more use the folder icon to open the one for
stuff. In this listing, the click the text for the name of the directory to be protected,
dropped. Now we are ready to put that lock on this.
Click the box for password protect this directory. The top portion of this editor includes a field to put a description of the directory used to display on the login box.
This is optional, but may help a visitor you sent here know what they are trying to access. Click Save. Below this, they enter a username and a password that is used to access this directory (make sure you keep track of this information to you can share it). Click Save again.
If you return to this same URL http://extendlabs.ca/stuff/dropped instead of seeing the contents, you are presented a login box. Without the username and password… you cannot see what is inside.
If you ever need to remove the protection, navigate back the same way, uncheck the box for password protect this directory and click Save. To change the password of a user, enter the same username and the new password in the lower section, and then Save.
You might use Directory Privacy just for a set of files, but it can also be done for an entire web directory, just see if you can get your way into http://extendlabs.ca/notme/.
Example for "Password Protecting Part of Your Domain":