Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
编辑hist文件,使像facebook.com这样的域显示我自己的html/php文件_Php_Html_Localhost - Fatal编程技术网

编辑hist文件,使像facebook.com这样的域显示我自己的html/php文件

编辑hist文件,使像facebook.com这样的域显示我自己的html/php文件,php,html,localhost,Php,Html,Localhost,例如,当我键入facebook.com时,我想显示我自己的内容,而不是facebook的内容。如何修改主机文件以执行此操作?将以下内容放入主机文件中: 127.0.0.1 facebook.com 这将把所有流量从facebook.com引导到127.0.0.1(localhost)。如果您没有在该IP上运行web服务器,则可以对其进行更改。但是,在加载facebook.com时,如何指向要显示的文件?您需要设置web服务器。如果您在windows上,请查看。

例如,当我键入facebook.com时,我想显示我自己的内容,而不是facebook的内容。如何修改主机文件以执行此操作?

将以下内容放入主机文件中:

127.0.0.1   facebook.com

这将把所有流量从
facebook.com
引导到
127.0.0.1
localhost
)。如果您没有在该IP上运行web服务器,则可以对其进行更改。

但是,在加载facebook.com时,如何指向要显示的文件?您需要设置web服务器。如果您在windows上,请查看。