password protect directory

Web hosting discussion, programming, and shared and dedicated servers.
3 posts Page 1 of 1
by Guest » Thu Jan 26, 2012 10:05 pm
Hi:

I am trying to password protect a directory using .htaccess, but keep receiving an Internal Server Error. Here is the script I am using from your wiki:

AuthUserFile /nfs/WWW_pages/mylogin/mydomain.com/newsite/.htpasswd AuthGroupFile /dev/null AuthName MyPassword AuthType Basic <Limit GET> require user name </Limit>

I have tried several different path combinations to get it to work, without success, including /home/WWW_pages/mylogin/mydomain.com/newsite/.htpasswd

and

/home/WWW_pages/mylogin/newsite/.htpasswd

The htaccess file is in the directory I want to protect = /newsite/

Frankly, I tried a different but similar script from the internet on my localhost, and didn't succeed there either.

Any suggestions? Thanks much!
Rgds, Ned
by tmsli » Fri Jan 27, 2012 7:47 am
Hi:

BTW, login name is tmsli

Thanks, Ned
by tmsli » Fri Jan 27, 2012 10:40 pm
Hi:

Problem solved -- must have misread the part about the htpasswd file also being needed.

FYI, had to modify the directory path somewhat:

AuthUserFile /nfs/WWW_pages/login/mydomain.com/newsite/.htpasswd
AuthGroupFile /dev/null
AuthName Secure
AuthType Basic
<limit GET>
require valid-user
</limit>
3 posts Page 1 of 1

Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 14 guests