惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tor Project blog
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Jina AI
Jina AI
雷峰网
雷峰网
博客园_首页
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Forbes - Security
Forbes - Security
T
Threatpost
V
Visual Studio Blog
A
Arctic Wolf
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy & Cybersecurity Law Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Spread Privacy
Spread Privacy
N
News and Events Feed by Topic
Vercel News
Vercel News
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
NISL@THU
NISL@THU
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
PCI Perspectives
PCI Perspectives
博客园 - 【当耐特】
IT之家
IT之家
S
Secure Thoughts
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
月光博客
月光博客
Latest news
Latest news
小众软件
小众软件
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
大猫的无限游戏
大猫的无限游戏

博客园 - IT爱好者

C# 自定义打印 C# 打印,不显示打印进度对话框 如何解决迅雷插件导致IE10崩溃的问题 ASP.NET MVC 使用Jquery Uploadify 在非IE浏览器下Http Error的解决方案 c#操作access,update语句不执行的解决办法 解决:System.Data.SqlClient.SqlError: FILESTREAM 功能被禁用 服务器“**”上的MSDTC不可用的解决办法 通过Package Manager Console 向VS2010安装 EFCodeFirst 删除SVN遗留的无用文件 解决"System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本" IIS服务器应用程序不可用的解决办法 使用XML与远程服务器进行交互 小米手机指令大全 Java与.NET DES加密解密互转 获取执行SQL语句的返回结果 ASP.NET中如何向页面写入JavaScript脚本内容 Oracle自增列创建方法 ASP.net中用JSON序列化对象 android Listview 拖动时背景为黑色问题
修改IIS默认的localhost名称
IT爱好者 · 2011-11-15 · via 博客园 - IT爱好者

看惯了http://localhost在本地测试的域名,想换种写法行不行,比如说想变成http://www.ceo.com,但网页访问仍然是原来http://localhost的内容,如何做到呢?

可以修改本机的一个文件来实现。

在系统盘中的如下路径

C:\WINDOWS\system32\drivers\etc

找到“hosts”文件,右键打开方式选择文本文件方式,可以看到如下内容:

# Copyright (c) 1993-1999 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

127.0.0.1    localhost

看到了吧,在最下边一行有

127.0.0.1 localhost

大家知道怎么做了吧?

就是在这行下添加新行,将localhost修改为想要的域名,如下

127.0.0.1 www.ceo.com

需要注意的是,“127.0.0.1”和“www.ceo.com”之间用Tab键间隔开

想添加什么域名就接着往下加好了,就这么简单。

添加完成后就保存,然后就可以用www.ceo.com访问自己本地的网站了。