Password Protect A Page

Website URL

(please specify the URL of the site on which you are experiencing the problem)
radcliffe-photography.free.nf

Error Message

500 Internal Server Error

Other Information

I’m trying to password protect a directory which will contain a collection of pictures as well as the html to display them.

My .htaccess is :

#Protect Directory With Password
AuthName "restricted area"
AuthType Basic
AuthUserFile ../Extras/.htpasswd
require valid-user

~
and .htpasswd in Extras is :

LittleMiracles:$apr1$bTT87PWU$GHi4sS3cmnSBR6e8wevW6.

However whenever I try to open the page
http://radcliffe-photography.free.nf/Photos1/Photo1.html
with the ,htaccess file in the Photos1 directory I get the Error 500 irrespective of what username and password I enter.

I’m sure this is my lack of knowledge and skill but I’m stuck what the problem might be.

Any advice gratefully received.

B

That does not look right.

Try deleting everything you have shown here and use the “Directory Privacy” feature in the control panel.

6 Likes

I think the AuthUserFile directive only works with absolute paths. Also, I think the last line should be Require valid-user, i.e. starting with a capital letter.

But setting up password protected directories is notoriously finicky if you do it by hand. I would suggest to use the Protected Directories feature in the client area (it’s better than the Directory Privacy tool in the control panel) to set it up instead.

7 Likes

Hi BestestGrandad,

Seems you have already changed the .htaccess file correctly.
image

Please mark the admin reply as solution if you have already made the change.

Cheers!

3 Likes

Thanks,
As suggested I dumped trying to do it by hand and used Protected Directories from the control panel which is so much simpler if less rewarding.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.