Forum Moderators: phranque

Message Too Old, No Replies

401 Authorization Required

help to configure htaccess file

         

freetimedesign

1:05 am on Oct 26, 2007 (gmt 0)

10+ Year Member



I am trying to password protect part of my website.
I created the .htaccess file and look like this:

AuthUserFile /www/folder/www.mywebsite.com/admin/.htpasswd
AuthName "Administrator section"
AuthType Basic
AuthUserFile .htpasswd
Require valid-user

the .htpasswd file is as following:
username:encryptedpassword

I uploaded the files with an extension .txt using ASCII then I changed the renamed them on inside the server's directory. Both files are in the same directory.
When I use the browser to type my username and password to get access to the directory this is what i got:

401 Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

Help will be greatly apreciated!

phranque

8:00 am on Oct 26, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, freetimedesign!

AuthUserFile /www/folder/www.mywebsite.com/admin/.htpasswd
...
AuthUserFile .htpasswd

which one?...

freetimedesign

4:20 pm on Oct 26, 2007 (gmt 0)

10+ Year Member



Thanks for the Greeting!
I was suppost to use the one on the top. The correct file should look like:

AuthUserFile /www/folder/www.mywebsite.com/admin/.htpasswd
AuthName "Administrator section"
AuthType Basic
Require valid-user

Is this correct?

g1smd

7:37 pm on Oct 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If it is correct, then it will work as you want it to.

Give it a try.