# Password Protection

**URL:** <https://forum.kirupa.com/t/password-protection/52397>\
**Category:** flash\
**Created:** [May 23, 2004, 4:46pm UTC](https://forum.kirupa.com/t/password-protection/52397 "2004-05-23T16:46:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FF50](https://avatars.discourse-cdn.com/v4/letter/f/65b543/32.png) [@FF50](https://forum.kirupa.com/u/FF50)\
**Post date:** [May 23, 2004, 4:46pm UTC](https://forum.kirupa.com/t/password-protection/52397/1 "2004-05-23T16:46:43Z")

</div>

Hello Everyone,

I am trying to password protect a directory on my site. I placed an .htaccess file in the directory with:

AuthType Basic  
AuthName “XXXXXXX”  
AuthUserFile /xxxxxx/.htpasswd  
require valid-user

I then went to the Password Generator at [http://www.euronet.nl/~arnow/htpasswd/](http://www.euronet.nl/~arnow/htpasswd/) to get a encrypted password which I placed in an .htpasswd file as such:

xxxxx:52s3jy3nf4SLw

When I try to access the protected page putting in my username and password, it returns:

error 401: Unauthorized

The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource.

I have looked at a few articles concerning this error, but still don’t understand. Hope someone can help.

Thanks!  
:hangover:
