views:

16

answers:

1

My first time using htaccess to ask for a user password. on my server

.htpasswd file lies in my root directory of my server.

.htaccess file lies in folder folder "uploads" (which lies in the root dir)

i used …

    <?php
    echo dirname(__FILE__);
    ?>

to get the full server path to my root dir.

my .htaccess file in my "uploads" folder looks like this now:

AuthType Basic
AuthName "Uploads to my website"
AuthUserFile /home/.sites/74/site484/web .htpasswd
Require valid-user

and my .htpasswd file in the root looks like this:

admin:$apr4$CxS3O/..$vJcWNd6tlUwg6PAn.6cpA1

now when i browser to mydomain.com/uploads i get:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

what am i doing wrong here?

thank you for your help!!!

+2  A: 

Looks like there's a space instead of a slash between the directory and file name in the AuthUserFile line.

jblocksom
jesus, you're right! man, sry for the question. now it's working!
@mathiregister: Accept the answer if its working now. Accepting the answer is the best way to thank anyone on SO.
Adeel Ansari
Great, glad to hear it's working!
jblocksom