Although we have an article on password protecting directories in the cPanel, there may be times when the structure of your program does not allow the movement of files. This is more common with Content Management Systems such as Wordpress or the Premium Website Builder. You may want or need to protect a single file from random outside access. For example, you may want to set one of your pages up to only be accessed by a certain group. Moving the file to another folder is impossible due to the coding of the site. This article will demonstrate how to password protect a single file via your .htacess file. This allows you to set the access to a specific username and password while keeping the file in the mandatory location.
n/a Points
|
2017-09-25 1:47 pm
Hi. the Step 1 link doesn't work.. Can you help with this. Thank you |
Staff 116 Points
|
2017-09-25 9:39 pm
Hello,
Thanks for letting us know about the dead link, We have updated it to a new URL that works, It may take a few minutes for the change to show however you can use this URL http://www.htaccesstools.com/htpasswd-generator/ to generate the line of code you need for step 1 now. Best Regards, Kyle M |
n/a Points
|
2018-08-10 8:13 pm
When I followed your instructions, it crashed my web site. I got a 500 internal error on all pages of the web site. I then removed the text from the .htaccess file and saved, and my web site came back. This is the code (that I placed at the bottom of the .htaccess file) that broke the web site: AuthUserFile /home/nqpart5/.ELCpassword AuthName "Emergent Learning Community Portal" AuthType Basic <files "EL_portal.html"> require valid-user </files> |
Staff 12,339 Points
|
2018-08-10 8:26 pm
If you have any other rules in the .htaccess file, they may be interfering with these rules your adding. As a test, you can rename the existing .htaccess file then add these rules to a new one.
Also, check that your hidden file titled "ELCpassword" is in the correct folder location and has the required code. Thank you, John-Paul |
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!