【IIS问题】——默认网站localhost无法打开,错误类型404

来源:互联网 发布:逆转三国上古神迹数据 编辑:程序博客网 时间:2024/05/16 11:03

前提

  小编最近在学习JQuery的一些内容,谁曾想上来的第一个Demo就把小编难住了,需要将本地html页面上文本框中的内容上传到服务器上,然后将服务器上的内容返回。而小编将文件放到IIS的默认网站上,本以为很简单,可是发现小编没有默认网站。而且在地址栏中输入localhost,提示错误404,。也许是手欠吧,不知道何时把默认网站删除了,这个可怎么办?各种尝试,最终找回了默认网站,解决了localhost无法登陆的问题。

解决方案

这个前提是建立在安装好iis的基础上的,在C:》Windows》System32》Drivers》etc中有一个hosts文件,选择文本格式打开就行了。将下述内容复制到其中。

# 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

注意下默认网站的端口为图中的样子,对于这个localhost规定就是这样的没有什么理由可言,按规矩做就可以了。然后重启计算机完美解决。


这里写图片描述

  话说虽然这个问题解决了但是小编的第一个demo还没实现呢,学海无涯啊,个人力量有限,尝试使用团队的力量,小编决定站在巨人的肩膀上,要求助师傅救援了啊。

总结

   通过这个问题真心觉得什么东西都有真心值得研究的地方啊,原本以为一个IIS无非就是发布个网站,怎么还有这么大学问,千万不要轻视每一个内容,每一个知识都是非常值得学习的,踏实学习每一个地方,从现在慢慢钻研,欢迎大家一起交流。

0 0
原创粉丝点击