htaccess的密码保护,但不能在本地主机 [英] htaccess password protect but not on localhost
问题描述
我已经建立了一个开发站点,并希望设置密码保护,以便只有经过验证的游客可以查看该网站。一切都很好。我越来越生气,在我的本地版本,输入我的用户名和密码。因此,在不改变我的本地副本和一个在开发站点之间的htaccess文件,我如何用密码保护的网站,但让自己进入,而不必输入自己的用户名和密码?
I have set up a dev site and want to password protect it so only validated visitors can view the site. All well and good. I am getting annoyed, on my local version, entering my username and password. So, without changing the htaccess file between my local copy and the one on the dev site, how do I password protect the site but allow myself access without having to enter my username and password?
推荐答案
像这样的东西应该做的伎俩。
Something like this should do the trick..
Require valid-user
Allow from 127.0.0.1
Satisfy Any
从:<一href="http://httpd.apache.org/docs/2.0/mod/core.html#satisfy">http://httpd.apache.org/docs/2.0/mod/core.html#satisfy
这篇关于htaccess的密码保护,但不能在本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!