Forum Moderators: phranque

Message Too Old, No Replies

.htaccess doesn't work with .htpasswd

apache shared hosting at godaddy.com

         

passfans

12:57 am on Feb 19, 2007 (gmt 0)

10+ Year Member



First of all, excuse my poor language

recently,i found out some people are trying to download url from hotlinks where i was intend to do charging service with many wma and mp3 files. To prevent this problem, i decided to creat a protected directory which requires paid user authetication.

I'm using linux shared hosting with apache from godaddy.com, i read
help articles which says i can put .htaccess at protected directory and .htpasswd at /home/content/l/o/g/login_name/html/. then i did,
the good thing is when i enter protected directory, borwser pops up for user name and password, the bad thing is browser wouldn't let me in even i can ensure the password i typed is fully correct.

here is my .htaccess file

AuthName Enterpassword
AuthUserFile /home/content/l/o/g/login_name/html/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
Require valid-user

here is my .htpasswd file (crypt with 123456:123456)

123456:0Sz0qZK6PrLqk

can anyone tell me what problem could possibly be?

passfans

1:03 am on Feb 19, 2007 (gmt 0)

10+ Year Member



By the way.

1. /home/content/l/o/g/login_name/html/ is sample path, i used mine instead!
2. does httpd.conf or php.ini needed? cuz i didn't found any of those files on my root or sub directory.

phranque

2:41 am on Feb 19, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, pf!

make sure you have

AllowOverride AuthConfig
set in your configuration.
also, i'm not sure if the null AuthGroupFile works against you but it's not necessary.

passfans

2:48 am on Feb 19, 2007 (gmt 0)

10+ Year Member



AllowOverride AuthConfig

Thanks for your reply
but i'm not sure how to config this file
can you paste a full config file here i can make sample with?
thank you very much

passfans

4:11 am on Feb 19, 2007 (gmt 0)

10+ Year Member



.htaccess (I put it [mydomain.com...]
AuthType Basic
AuthName "Members Area"
AuthUserFile /home/content/l/o/g/login_name/html/.htpasswd
require valid-user

.htpasswd (I put it /home/content/l/o/g/login_name/html/)

123456:cwc9eWGIM9r5M

httpd.conf (I put it /etc/httpd/htdocs/)

<Directory \"/membersdownload\">
Options Indexes FollowSymlinks
AllowOverride AuthConfig
Order Allow,Deny
Allow From all
AuthName "Members Area"
AuthType Basic
AuthUserFile /home/content/l/o/g/login_name/html/.htpasswd
Require valid-user
</Directory>

wiondow pops up, but password still not working.
any comments on this?

phranque

4:15 am on Feb 19, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



look at the server error logs - there should be an error there if your directives are wrong.

another thing i thought of that you can check is to make sure the permissions on the .ht* files are correct for access by the server.

you might want to look at the following to sort out all the issues:
[httpd.apache.org...]
[httpd.apache.org...]

passfans

9:37 pm on Feb 20, 2007 (gmt 0)

10+ Year Member



look at the server error logs - there should be an error there if your directives are wrong.
another thing i thought of that you can check is to make sure the permissions on the .ht* files are correct for access by the server.

you might want to look at the following to sort out all the issues:
[httpd.apache.org...]
[httpd.apache.org...]

phranque, thanks for your help..i've checked user manule, but couldn't find any useful keywords. no error logs at all or i
didn't find it on the server. if you feel comfortable, i'd like to
give you my ftp account to check for me. send me a pm please