-1 windows localhost hosts-file
https://example.com/en/b9ah我正在尝试使用主机文件阻止该网站。
我转到文件资源管理器、此电脑、选定的 Windows、System32、驱动程序、等等、主机文件,复制主机文件并将其粘贴到我的桌面上,然后在记事本中打开复制的版本。
我输入( 0.0.0.0 https://example.com/en/b9ah)没有www,只有https://。
我保存了从记事本中关闭的文件,在桌面上选择了复制的版本,将其拖到带有主机文件的文件资源管理器中,放入窗口中,并收到消息“您要替换吗”,我确认了替换,我确认了管理员访问权限,然后打开原始主机文件,以确保我的更改确实存在。
在有人建议重新启动我的计算机或删除缓存或cookie之前,我还设置了另一个网站作为测试:
www.another.com =0.0.0.0 www.anotherexample.com
Run Code Online (Sandbox Code Playgroud)
在重复与我实际想要阻止的网站相同的过程后,该网站仍然具有旧的缓存和 cookie,被阻止了。
但我想屏蔽的网站并没有被屏蔽。
因此,我得出的结论是,问题出在我在主机文件中使用的 URL。将此站点添加到主机文件以阻止它的正确方法是什么?
我确实0.0.0.0 example.com按照别人告诉我的那样做了,但它仍然不起作用:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
0.0.0.0 example.com
Run Code Online (Sandbox Code Playgroud)
像这样:

和这个:

我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
926 次 |
| 最近记录: |