Password protecting a single page

Asked by:
craiglindley / 16 Points
Time:
2013-04-27 5:47 pm EST
Category:
Htaccess
Hits:
1,183
I created a .mypassword file in my home/craiga6 directory with a password created here: http://www.htaccesstools.com/htpasswd-generator/

I then created a file .htaccess in the public_html director like this:

AuthUserFile /home/craiga6/.mypassword
AuthName "C and H Contact Page"
AuthType Basic
require valid-user
When I access my contpage I get an error. What is wrong

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

ScottM
Staff
16,266 Points
2013-04-29 4:21 pm EST
Hello craiglindley,

When wanting to password protect a single file in .htaccess, you can find the instructions in our article below:

Password protecting a single file in .htaccess

If you find in testing that it is not working, you will want to follow a couple of quick troubleshooting steps.

1) ensure that the files (.htaccess, .htpassword, and the file you want protected) are in the correct place.

2) If those are correct, please ensure you check both the password file and .htaccess files for errors, specifically typos. .htaccess is very unforgiving in this manner, including extra spaces.

3) If both of those efforts pass, you are free to contact our Live Support team, where a technician can walk through the issue live and watch the behavior to troubleshoot the issue.

Best Regards,
Scott M

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}