密码保护目录中的.htaccess密码保护、目录中、htaccess

2023-09-02 00:46:26 作者:删除回忆录

你好我想密码保护的目录与htaccess的。 我创建了一个htpasswd的文件,并在服务器的根目录保存它。 我在目录中创建一个.htaccess文件我想保护与下面几行:

Hi I am trying to password protect a directory with .htaccess. I have created a .htpasswd file and stored it at the root of the server. I have created a .htaccess file in the directory I want to protect with the following lines:

AuthUserFile /home/baltzers/domains/baltzersciencepublishers.com/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "restricted area"
require user test

但是,当我填写了用户名(加密)密码,它不断抛回了身份验证对话框。 我在想什么?

But when I fill in my username and (encrypted) password, it keeps throwing back up the authentication dialog. What am I missing?

推荐答案

您mught要替换的行要求用户测试

You mught want to replace the line require user test with:

require valid-user

否则,用户必须被命名为测试和存在于 htpasswd的文件。