简体   繁体   English

如何验证用户访问我的站点?

[英]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.

相关问题 如何为我的Android应用验证用户身份? - How do I authenticate users for my Android app? 如何避免假冒用户注册我的Joomla网站 - how to avoid fake users to register my Joomla site 当他尝试向我的IIS进行身份验证时,如何获得有关用户网络的信息? - How can I get information about the users network when he tries to authenticate towards my IIS? 如何在不将密码保存在数据库中的情况下对用户进行身份验证 - how to authenticate users without saving passwords in database Android 消费webservice的APP如何认证用户 - Android APP that consumes a webservice how to authenticate users 如何从休息服务验证用户 - How to authenticate users from a rest service 如何对数据库中的数据进行加密并重新使用以验证用户身份 - how to encrypt data in database and reuse it to authenticate users 如何将站点用户登录到另一个站点 - How to log site users in to another site 验证我的Android应用程序用户的最佳方法是什么? - What is the best method to authenticate users for my Android application? 如何使用户难以将mp3文件从我的网站保存到他们的硬盘上? - How do I make it difficult for users to save mp3 files from my site to their hard drives?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM