简体   繁体   English

加载网站之前如何在网站上进行用户名和密码保护

[英]How to do a USER NAME & PASSWORD protection in a web site before it is loading

How can we able to protect a site using USERNAME and PASSWORD after we entering the URL and the site is before loading 输入URL并且网站在加载之前,如何使用USERNAME和PASSWORD保护网站

For ex: http://www.buildyourownbouquet.com/ 例如: http : //www.buildyourownbouquet.com/

I need exactly what it looks like... 我完全需要它的外观...

Thanks in Advance 提前致谢

Fero 费罗

It's called HTTP authentication. 这称为HTTP身份验证。 If you're using Apache, you can read about it in the docs . 如果您使用的是Apache,则可以在docs中阅读有关它的信息

Here's an htaccess generator for you, simple enter the details, download htaccess and place it in the directory you want to protect: 这是为您提供的htaccess生成器,只需输入详细信息,下载htaccess并将其放置在您要保护的目录中:

http://www.htaccesstools.com/htaccess-authentication/ http://www.htaccesstools.com/htaccess-authentication/

This is called a HTTP AUTH. 这称为HTTP AUTH。 And is described in this tutorial 并在本教程中进行了描述

php has a mechanism for this. php为此有一种机制。 see example #2 on this page of the manual. 请参阅本手册第2 上的示例#2。

Or, as x2 pointed out, you could use htaccess. 或者,如x2所指出的,您可以使用htaccess。 I assume you are using apache. 我认为您正在使用apache。 Check here . 在这里检查。

可以使用htaccess文件来完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM