This article will show you how to password protect your EECS webpages using Apache Htpasswd.
These generated strings should be placed in the .htpasswd file. Multiple usernames and passwords can be stored in the .htpasswd file, each separated by a newline.
Step 2. Protecting a directory
To protect a directory, first create the directory that you wish to protect in public_html. Once you've done this, a file named .htaccess should be placed inside the directory that contains the following text:
AuthName "Protected Directory"
where /path/to/.htpasswd is the full path to the .htpasswd file on the server. Once you've created this file, your directory should be password protected.
Step 3. Password protecting a file
If you wish to only protect a single file, place the .htaccess file in the same directory and insert the following text:
AuthName "Protected File"
where page.html is the name of the page that you want to password protect.
Step 4. Accessing your protected pages
When you attempt to access your protected page, you should be met with a prompt like this:
After entering a valid username and password, you should have access to the protected page.