Error 500 when using .htaccess and .htpassword


#1

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

username:encryptedpassword

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.


#2

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.


#3

Oh, Much easier. Thank You!


#4

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)


#5

Black Friday Sale 90% OFF
0
DAYS
0
HOURS
0
MINUTES
0
SECONDS
×