Forum Moderators: phranque

Message Too Old, No Replies

Can't get .htaccess to work with .htpasswd

         

JonnyOctagon

1:23 am on Nov 15, 2007 (gmt 0)

10+ Year Member



I'm having the exact same problem as in this ([webmasterworld.com ]) post... I'm assuming this problem was fixed but there is no update to the post and I am unable to post in that thread b/c it is now closed (due to inactivity)...

I was refered by godaddy support to this ([help.godaddy.com ]) page and have followed those steps exactly but it is still not working.

When I go to my page I get the pop up asking for username and password but it always tells me my password is incorrect.

I'm at a loss.. Please someone help.

phranque

3:57 am on Nov 15, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], JonnyOctagon!

if you post your examplified .htaccess file, we might be able to see something.
just to make sure it is seeing your changes at all, i would try changing the value for AuthName and see if it shows up in the login popup window.

JonnyOctagon

9:17 am on Nov 15, 2007 (gmt 0)

10+ Year Member



Thanks phranque :)

My .htaccess file is as follows:

AuthUserFile /home/content/d/o/u/example/html/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic

require valid-user

I just tried changing the authname and I did indeed see the change.

The website url is http://www.example.com with http://www.example.com/admin the directory I'm trying to password protect.

My .htpasswd file is located at http://www.example.com/home/content/d/o/u/example/html/.htpasswd

I've tried putting the .htpasswd file in different directories and changing the .htaccess file accordingly. I've tried using several different password encrypters (on various websites) as well as one that I found that was supposedly specifically for godaddy linux servers (b/c according to that poster godaddy needed a special encryption). I've also tried using no encryption at all and just putting username:password in the .htpasswd file.. Nothing seems to work..

[edited by: jdMorgan at 3:47 pm (utc) on Nov. 15, 2007]
[edit reason] example.com. Please see Terms of Service [/edit]

phranque

2:08 pm on Nov 15, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have you checked your error log?
it might give a clue to the specific authentication error.

JonnyOctagon

9:14 pm on Nov 15, 2007 (gmt 0)

10+ Year Member



Here are the errors I'm getting:

[Thu Nov 15 14:12:59 2007] [error] [client 71.229.159.220] (2)No such file or directory: Could not open password file: /home/content/d/o/u/example/html/.htpasswd

[Thu Nov 15 14:12:59 2007] [error] [client 71.229.159.220] user example not found: /admin

[edited by: jdMorgan at 3:22 pm (utc) on Nov. 16, 2007]
[edit reason] examplified [/edit]

JonnyOctagon

9:29 pm on Nov 15, 2007 (gmt 0)

10+ Year Member



Ok.. So I figured it out.. When I put the .htpasswd file in my top lvl directory it finally worked and I was able to log in..

So I guess the server see's /home/content/d/o/u/example/html/ as my top level directory.. Before I had actually created the path /home/content/d/o/u/example/html/.htpasswd but what it actually needed to be (with that in mind) /home/content/d/o/u/example/html/home/content/d/o/u/example/html/.htpasswd

[edited by: jdMorgan at 3:24 pm (utc) on Nov. 16, 2007]
[edit reason] example.com per TOS [/edit]

JonnyOctagon

9:40 pm on Nov 15, 2007 (gmt 0)

10+ Year Member



Now my next question.. What do I need to add to the configure.php file to make it automatically switch to the secured server when I enter the /admin area?