如何使用 .htaccess 密码保护 WordPress 博客
这个问题是关于我的电脑上在本地网络上共享的本地主机的。我希望选定的人使用 .htaccess 方法或类似的方法访问该网站。我将以下代码用于 .htacces/.htpasswd 方法
// .htaccess file
AuthName "Realm name"
AuthType Basic
AuthUserFile .htpasswd
require valid-user
// .htpasswd file
frances:WrU808BHQai36
此方法应该是工作,但它对我不起作用。我曾经收到要求输入用户名和密码的对话框,但再也没有出现过?这个方法在本地主机上有效吗?注意:我的 WordPress 博客位于 C:\blog 文件夹中,该文件夹位于 XAMPP HTDOC 文件夹之外。
This question is with respect to local host on my PC which is shared on the local network. I want selected people to access the website using .htaccess method or something similar. I used the following code for .htacces/.htpasswd method
// .htaccess file
AuthName "Realm name"
AuthType Basic
AuthUserFile .htpasswd
require valid-user
// .htpasswd file
frances:WrU808BHQai36
This method is suppose to work but it is not working for me. I once got the dialog box asking for username and password but never again? Does this method work on localhost. Note: my wordpress blog is sitting in C:\blog folder which is outside XAMPP HTDOC folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的浏览器将在输入您的信息时存储您的身份验证,因此您只需要进行一次身份验证。要解决此问题,请清除缓存/cookie,然后系统会再次提示您输入密码。
Your browser will store your authentication on entering in your information so you only will need to authenticate once. To fix this, clear your cache/cookies and you should get prompted for a password again.
我遇到了两个问题。一是.htaccess 文件错误,二是密码加密错误。修复此问题后一切正常。注意:我访问了许多网站,但它们的加密对我不起作用。
为了正确加密 XAMPP 1.7.6,此网站生成的密码对我有效,但对于许多其他的却没有。
有些甚至提供了完整的 htaccess 和 htpasswd 重写像这个,但它对我不起作用。
There were two problems that I were having. One was wrong .htaccess file, the other was wrong password encryption. After fixing this everything worked fine. Note: I visit a number of site and their encryption did not work for me.
For correct encryption for XAMPP 1.7.6, the password generated by this site worked for me but for many other it did not.
Some provided even complete htaccess and htpasswd rewrite like this one but it did not work for me.
使用起来更方便
WordPress › 绝对隐私 « WordPress 插件
Much easier to use
WordPress › Absolute Privacy « WordPress Plugins