解决IIS默认网站删除后localhost无法访问的完整指南

2025-03-19
来源:网络整理

前提

编辑最近正在学习的一些内容。任何曾经认为出现的第一个演示的人都会使我陷入困境。我需要在本地HTML页面上的文本框中上传内容到服务器,然后返回服务器上的内容。编辑将文件放在IIS默认网站上。我认为这很简单,但是我发现编辑没有默认网站。如果您在地址栏中输入它,它会提示错误404。也许是因为我欠了我的手。我不知道何时删除默认网站。我应该怎么办?经过各种尝试,我终于找到了默认网站,并解决了无法登录的问题。

解决方案

此前提是基于IIS的安装。 C:》》》》等中有一个文件。只需选择文本格式以打开它即可。将以下内容复制到其中。

# 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

请注意,默认网站端口看起来像图片中。没有理由这样的法规。只需遵守规则即可。然后重新启动计算机并完美解决。

顺便说一句,尽管解决了这个问题,但编辑的第一个演示尚未实现。知识是无穷无尽的,他的个人力量也有限。试图利用团队的力量,编辑决定站在巨人的肩膀上,并寻求主人的帮助进行救援。总结

通过这个问题,我真的觉得一切都值得学习。我最初认为IIS不过是发布网站,但是为什么它有一个很棒的问题呢?不要低估所有内容。每个知识都非常值得学习。从现在开始,稳定地学习每个地方并慢慢研究。欢迎每个人一起交流。

分享