I'm trying to lock personal files out for me personally only (it is a log, and I'm not going customers to determine it).

This really is my .htpasswd:

foo:bar

Which is my .htaccess:

AuthUserFile /home/kapip/public_html/.htpasswd
AuthType Basic
AuthName "This is allowed for admin purposes only"

<Files "users.log">
  Require valid-user
</Files>

Even when I make the correct password following the dialog, the dialog just flashes as though the request was sent, after which it appears again. Regardless of what I place in, I can not see my file.

Some Specs

  • I am on hosting that is shared
  • The .htpasswd, .htaccess, and log file have been in exactly the same directory
  • Even when i change customers.log to customers.txt, still it does not work
  • Basically click "cancel" if this requests qualifications, it provides a 401 Response

Help me! :(

Have you run htpasswd -c in your password file? It's ordinarily a hash and never a plaintext password. Have a look in the htpasswd man page.


EDIT:

Without having spend access, you may create your htpasswd file while using htpasswd generator and also the copy the file for your shared host. You need to have the ability to use cPanel's FileManager.

One factor that I recommend though: You shouldn't place your htpasswd file inside your public_html directory, individuals will have the ability to can get on via http://your-domain/.htpasswd that is VERY BAD