本文介绍了IIS不提供静态内容(css / js / images等)404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
- 创建项目(在这种情况下,它只是使用$ b的空web应用程序
- 编辑hosts文件以允许自定义URL(local.xxx-xxx.com) 创建IIS网站和应用程序池指向local.xxx-xxx.com和
选择启动目录。 - 编辑根文件夹的权限以允许IIS_IUSRS和NETWORK
SERVICE能够访问文件。
我已进入IIS检查Windows功能中是否选中了静态内容复选框,它是。
我没有看到什么?
另外,例如,当我浏览到
元素的元素为静态内容类型的集合添加一个唯一的MIME类型。每个条目必须由两部分组成:
I have done this 1 million times....
- Create project (in this case it's empty web application using onlyHTML files).
- Edit hosts file to allow custom URL (local.xxx-xxx.com)
- Create IIS website and app pool to point to local.xxx-xxx.com andchoose start directory.
- Edit permissions on root folder to allow IIS_IUSRS and NETWORKSERVICE to be able to access files.
I've gone into IIS to check if "Static Content" checkbox was checked in "Windows Features", and it is.
What am I not seeing?
Also, for example, when I browse to "http://local.xxx-xxx.com/source/sass/main.min.css" I get:
HTTP Error 404.0 - Not FoundThe resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
解决方案
The element of the element adds a unique MIME type to the collection of static content types. Each entry must consist of two parts:
这篇关于IIS不提供静态内容(css / js / images等)404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!