I have created a .htpasswd
file using htaccess tools of which I have uploaded to the root of my web hosting space (/public_html
is my web root).
I created a .htaccess
file which referenced the .htpasswd
as follows:
AuthType Basic
AuthName "Protected Area"
AuthUserFile /.htpasswd
Require valid-user
However, when I uploaded this .htaccess
file to the directory I want to password protect and accessed the folder via the URL in my browser it returns a 500 internal server error. I have used this same method before successfully.
Am I referencing the .htpasswd
file incorrectly? I also uploaded it to /public_html/
in case .htaccess
interprets /
as the web root, but the error remains.
Any ideas what is wrong?