Error 500 when using .htaccess and .htpassword


It won’t work and I don’t know why.

I’ve tried for hours to get .htaccess and .htpassword to work for a specific part of my website.

Here’s the code for .htaccess

AuthType Basic
AuthName "Welcome. Please Enter Your Password."
AuthUserFile /public_html/assets/testprivate/.htpasswd
Require valid-user

And here’s the code used for the .htpasswordfile


The password box appears but I don’t know why once it is entered the page doesn’t appear?

Can someone please help me. Is there also a way that I could make it so that only certain users can view the page?

Thanks in advance.


Hi @helpmeplease!

If you want to secure a directory using a password, please go to 000webhost cPanel > Settings > Security > Manage password protection. The password is encrypted using a hashing algorithm, so you can’t just input it in plain text.


Oh, Much easier. Thank You!


My pleasure :blush:

Note to clear your browser cache before attempting to access the secured directory again (do this to prevent the popup of the cached 500 Error)