本文介绍了密码保护目录中的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好我想密码保护的目录与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的
文件。
这篇关于密码保护目录中的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!