PDA

View Full Version : Setting up .htaccess and .htpasswd


slimshady26
06-02-2006, 09:08 PM
Hello,

I'm attempting to setup a password protected directory on my site, but am having some problems with authenication.

I created a .htaccess file as follows and placed in the protected directory:

AuthUserFile /homepages/36/d162742468/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Area"
AuthType Basic
require valid-user

Along with a .htpasswd file as follows and placed in my base directory:
admin:f2tlZHelFHD/.


When I try to access the protected directory, I get the authenication window, however, my user/password of admin:test does not work as I get a 401 error.

Does anyone see anything that I am doing wrong? Is the path for the .htpasswd file missing something?

Thanks.

aldee
06-03-2006, 04:54 AM
I don't think you've got write permissions to /homepages/36/d162742468/. You've probably placed your file in /homepages/36/d162742468/htdocs/, so your AuthUserFile path is wrong.

slimshady26
06-03-2006, 11:24 AM
Thanks.. . I just put the htpasswd file in the home directory. I don't see a directory titled htdocs.

slimshady26
06-03-2006, 11:28 AM
That worked. I didn't realize that the first home directory that you're in is title htdocs.

Thanks again.