Jump to content

Recommended Posts

Posted

Hi I have a website which I want to test restricting access with an .htpasswd file. The setup seems simple enough - just create the file, use a password generator to populate the contents of the htpasswd file, then set up your htaccess file and you're good to go. I've done everything correct (I think), but I get 'Internal Server Error 500' on my site when I try it out. I'm thinking possibly the path to the .htpasswd is not correct?

 

What I have in .htaccess is:

 

AuthUserFile /xyz/.htpasswd

AuthType Basic

AuthName "Login Details"

Require valid-user

 

The directory /xyz is in the /public_html folder. Would this path be correct? Or is there another path I should use here? Thanks for any help.

Posted

That would not be the path. You would have to enter it as /home/user-id/folder/.htpasswd

 

While I have never tried using it, you might want to check with the help desk to see if it's possible.

Posted

Thanks Bruce that path solved my problem and it works.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...