当前位置:网站首页>域名重定向工具 —— 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
- 小程序毕设作品之微信体育馆预约小程序毕业设计成品(4)开题报告
- SOM Network 1: Principles Explained
- APP专项测试:流量测试
- 解决 win10 下 ISE14.7的 iMPACT 崩溃问题 - FPGA 笔记
- 漫长的投资生涯
- (翻译)按钮的对比色引导用户操作的方式
- 将vim与系统剪贴板的交互使用
- Ten years after graduation, financial freedom: those things that are more important than hard work, no one will ever teach you
- 迁移学习——Discriminative Transfer Subspace Learning via Low-Rank and Sparse Representation
猜你喜欢

JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法

小程序毕设作品之微信体育馆预约小程序毕业设计成品(1)开发概要

【开源】Sentinel高性能高可用集群限流解决方案

seaborn笔记:可视化统计关系(散点图、折线图)

第一讲 测试知多少

APP专项测试:流量测试

找工作必备!如何让面试官对你刮目相看,建议收藏尝试!!

xctf攻防世界 Web高手进阶区 webshell

JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method

SOM Network 2: Implementation of the Code
随机推荐
【C语言实现】最大公约数的3种求法
long investment career
数据分析面试手册《指标篇》
Graph Theory - Strongly Connected Component Condensation + Topological Sort
03. GO language variable definition, function
Today's sleep quality record 74 points
[ASM] Bytecode Operation MethodWriter
[深入研究4G/5G/6G专题-48]: 5G Link Adaption链路自适应-4-下行链路自适应DLLA-PDCCH信道
如何理解 new (...args: any[]) => any
2022 edition of MySQL tutorial, top collection good, take your time
Getting Started Database Days4
KMP 字符串匹配问题
复现gallerycms字符长度限制短域名绕过
小程序毕设作品之微信体育馆预约小程序毕业设计成品(3)后台功能
【移动Web】移动端适配
深度学习Course2第一周Practical aspects of Deep Learning习题整理
递归(各经典例题分析)
String - Trie
PHP算法之最接近的三数之和
[Niu Ke brush questions-SQL big factory interview questions] NO4. Travel scene (a taxi)