【发布时间】:2011-08-25 16:37:55
【问题描述】:
我正在尝试使用密码保护我的公用文件夹,以便任何尝试从外部访问的人都会被提示输入密码,而不是在本地输入密码。到目前为止,我已经使用 127.0.0.1 但不是 localhost 让它工作。显然我可以只使用 IP 地址,但更重要的是我想知道它为什么不起作用。我不喜欢被打败!
#Enable Password Protection
AuthName "Password Protected Server"
AuthType Basic
AuthUserFile c:\xampp\apache\security\.htpasswd
Require valid-user
Order allow,deny
Allow from localhost
Allow from 127.0.0.1
Satisfy Any
到目前为止,我的代码是以下内容的积累:
http://www.groovypost.com/howto/how-to/htaccess-password-protect-apache-website-security/
htaccess password protect but not on localhost
我在 Windows 7 上运行 XAMPP 1.7.3,以防万一。
任何帮助将不胜感激!
【问题讨论】:
标签: security apache .htaccess xampp