[英]How to authenticate users to my site?
I simply want people to authenticate themselves when typing in my website URL.我只是希望人们在输入我的网站 URL 时进行身份验证。 For example, I saw an article on 10/20/14 that said that FX was coming out with a website for the Simpsons called 'simpsonsworld.com' so I visited the site (to check it out).
例如,我在 14 年 10 月 20 日看到一篇文章,说 FX 推出了一个名为“simpsonsworld.com”的辛普森一家网站,所以我访问了该网站(查看)。 However, later in the article it said that the site was not becoming live until 10/21/14 (today).
但是,在文章的后面它说该站点直到 14 年 10 月 21 日(今天)才会上线。 When I typed in 'simpsonsworld.com' into the URL, a dropdown box asked me to authenticate myself (username & password).
当我在 URL 中输入“simpsonsworld.com”时,一个下拉框要求我进行身份验证(用户名和密码)。 When you visit the site today (10/21), the site is completely visible.
当您今天 (10/21) 访问该站点时,该站点是完全可见的。
How do I get this drop-down box when someone types in 'myurl.com'?当有人输入“myurl.com”时,我如何获得这个下拉框?
Thank you!谢谢!
Use .htaccess
and .htpassword
.使用
.htaccess
和.htpassword
。 From http://davidwalsh.name/password-protect-directory-using-htaccess来自http://davidwalsh.name/password-protect-directory-using-htaccess
.htaccess should contain .htaccess 应该包含
AuthType Basic
AuthName "restricted area"
AuthUserFile /the/path/youre/protecting/.htpasswd
require valid-user
.htpasswd should contain .htpasswd 应该包含
username:password
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.