This makes it harder for anyone who gets access to the backend of your website to actually make changes. When you password protect a directory or subdirectory, you are improving the overall security of your website. Protecting Your Directories, Protects Your Website You will need to repeat this process to reinstate protection.
If either of the files is deleted, the directory will no longer be password protected. However, it’s unlikely that you’ll accidentally delete this file. htaccess file in the directory being protected is not deleted while you’re working on your site. htpasswds directory above your home directory. You also get a “passwd” file outside of the publicly viewable structure of your website. You get a “.htaccess” file in the directory being protected. What’s Happening Behind the ScenesĬPanel creates two files when it password protects a directory. You will once again see the success message, indicating that your directory is now password protected.Ĭongratulations on password protecting your directory. Once you have filled in the necessary information, click the “Save” button. If you need help making a strong password, check out this tool. Note: The system will analyze your password or passphrase and reject it with a “password strength” error if it is too short or not sufficiently complex. Make sure that you write down this unique user’s login information. You must enter a new user name and password. This cannot be the same as your information. Be aware that if your web browser has autofill turned on, it will enter your information into the fields. The second part of the process is to create a new user that can access the directory. You will now see a success notification signaling that everything happened correctly. It will automatically add Protected ‘your directory name’ in this text spot, which will suffice for most websites. Note: This does not have to be the actual name of the directory.
Click on the “Save” button when you are done. In this textbox, you must enter a name for the directory. The first involves picking a name for your directory, and the second is to actually add a password to a folder.Ĭheck the small checkbox to “Password protect this directory” and it will unlock the textbox below it. There are two steps to password-protecting a directory. Note: There is a “Private” column that will tell you if the directory already has a password or not. Click on the “Edit” button for the directory you wish to add password protection to. This will allow you to make the directory password protected. On the right-hand side of a directory, you will notice an “Edit” button. You can click on a directory to access its subdirectories, which can also be password protected. You will now see a full list of all of your website’s directories. Thus, it’s the first stop on how to put a password lock on a folder. This section of the cPanel is dedicated to password protection. Log in to cPanel, and locate the Files section. The process is very quick, so let’s begin. This information is provided to you by your web host. How to Password Protect A Directory Step 1: Click on Directory Privacyīefore beginning, you will need access to the cPanel of your website. Let’s go over the process of password-protecting directories in cPanel together. This will help restrict content when you don’t want it made publicly available. Why Password Protect a Directory?Ĭommonly used to protect downloads, files, or pages that you only want specific people to access, learning how to password protect directories will pay dividends for as long as your websites last. Today, I will demonstrate how to password protect a directory on your website using cPanel. Password protection allows you to control access to content that you do not want to be publicly available, and it prevents Google and other search engines from discovering and indexing the content. As a result, the security of your website is improved.Īfter all, it will cause issues for any hackers that end up there as well. If you password protect a folder, it will prevent others from accessing the files contained within. If you have provided login access to your cPanel to multiple people, you might want to consider password-protecting some directories.