开发者

htaccess and htpasswd?

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 brow开发者_如何学JAVAser 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!!!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜