htaccess以及htpasswd的? [英] htaccess and htpasswd?

查看:210
本文介绍了htaccess以及htpasswd的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用htaccess的要求输入用户密码。 我的服务器

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

htpasswd的文件就在于我的根​​我的服务器的目录。

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

.htaccess文件位于文件夹中的文件夹上传(它位于在根目录)

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

我用...

    <?php
    echo dirname(__FILE__);
    ?>

要获得完整的服务器路径,以我的根目录。

to get the full server path to my root dir.

在我的上传我的.htaccess文件夹看起来像现在这样:

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

和我的根htpasswd的文件看起来是这样的:

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

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

现在,当我浏览器mydomain.com/uploads我得到:

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

内部服务器错误 服务器遇到一个内部错误或配置错误,无法完成您的请求。

我在做什么错在这里?

感谢您的帮助!

推荐答案

看起来像有一个空间,而不是在的AuthUserFile行的目录和文件名之间的斜杠。

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

这篇关于htaccess以及htpasswd的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆