当前位置:网站首页>域名重定向工具 —— SwitchHosts 实用教程
域名重定向工具 —— SwitchHosts 实用教程
2022-08-01 22:18:00 【朝阳39】
下载安装
方式一:官网下载

在下载页中,找到对应操作系统的合适版本

方式二:网盘下载
版本为:SwitchHosts_windows_installer_x64_4.1.2.6086.exe
链接:https://pan.baidu.com/s/16izLHTlqwnIV3Bawxainzw?pwd=31e5
安装
双击打开安装包,一直下一步即可。
使用
双击打开安装好的桌面快捷方式
默认能看到系统hosts,为只读状态,无法修改。
我们新建一个自己的 host

自定义名称为 test 后确定
添加内容为
127.0.0.1 cc.com
即具体IP对应的域名
功能为:当访问 cc.com 时,就会重定向到访问IP 127.0.0.1
最后启动 host


检测效果
- 在桌面上新建文件夹 test
- 用vscode打开文件夹 test
- 在文件夹 test内新建文件 index.html 内容为
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h1>你好</h1>
</body>
</html>
- 点右下角的 Go Live 启动本地服务

若无此按钮,则需先安装插件 Live Server
启动后,浏览器会自动打开
http://127.0.0.1:5500/index.html

- 用 cc.com 替换掉 127.0.0.1
浏览器访问 http://cc.com:5500/index.html

浏览器提示域名进行了重定向,并且页面内容与 http://127.0.0.1:5500/index.html 相同,即说明 host 配置成功!
边栏推荐
- AQS
- 如何防范 DAO 中的治理攻击?
- NgRx Store createSelector 的单步调试和源代码分析
- Implementation principle of VGUgarbage collector (garbage collector)
- JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
- 图论——强连通分量缩点+拓扑排序
- 【Verilog刷题篇】硬件工程师从0到入门1|基础语法入门
- scikit-learn no moudule named six
- 数据分析面试手册《指标篇》
- (*゚ヮ゚)*【精品C语言整理】*(゚ヮ゚*)女盆友缠着你让你教她写代码怎么办?安排,三万字博文带你走遍C语言,从此不再害怕编程
猜你喜欢

How to prevent governance attacks in DAOs?

迁移学习——Discriminative Transfer Subspace Learning via Low-Rank and Sparse Representation

Go 微服务开发框架DMicro的设计思路

Raspberry Pi information display small screen, display time, IP address, CPU information, memory information (C language), four-wire i2c communication, 0.96-inch oled screen

Use Jenkins for continuous integration, this knowledge point must be mastered

程序员必备的 “ 摸鱼神器 ” 来了 !

Prufer序列

13、学习MySQL 分组

第一讲 测试知多少

Postman 批量测试接口详细教程
随机推荐
Ten years after graduation, financial freedom: those things that are more important than hard work, no one will ever teach you
今日睡眠质量记录74分
Mini Program Graduation Works WeChat Food Recipe Mini Program Graduation Design Finished Product (8) Graduation Design Thesis Template
数据分析面试手册《指标篇》
xctf attack and defense world web master advanced area web2
_ _ determinant of a matrix is higher algebra eigenvalue of the product, the characteristic value of matrix trace is combined
小程序毕设作品之微信体育馆预约小程序毕业设计成品(4)开题报告
LeetCode952三部曲之二:小幅度优化(137ms -> 122ms,超39% -> 超51%)
【牛客刷题-SQL大厂面试真题】NO4.出行场景(某滴打车)
feel so stupid
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (4) Opening Report
联邦学习入门
Implementation principle of VGUgarbage collector (garbage collector)
03、GO语言变量定义、函数
别看了,这就是你的题呀
SOM网络2: 代码的实现
xctf攻防世界 Web高手进阶区 webshell
基于 OData 模型和 JSON 模型的 SAP UI5 表格控件行项目的添加和删除实现
罗克韦尔AB PLC RSLogix5000中的比较指令使用方法介绍
2022-08-01 第八组 曹雨 泛型 枚举