你好我想密码保护的目录与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的
文件。