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

推荐订阅源

S
Security Affairs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
A
About on SuperTechFans
Last Week in AI
Last Week in AI
博客园 - 叶小钗
博客园 - Franky
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
The Hacker News
The Hacker News
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LangChain Blog
WordPress大学
WordPress大学
美团技术团队
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
S
Securelist
T
Tenable Blog
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 热门话题
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
L
Lohrmann on Cybersecurity
P
Privacy & Cybersecurity Law Blog
月光博客
月光博客
P
Proofpoint News Feed
Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
博客园 - 【当耐特】
A
Arctic Wolf
aimingoo的专栏
aimingoo的专栏

博客园 - iQingHan

C#中二进制和流之间的各种相互转换 underscore-1.8.3-analysis.js 经典JS 12 extremely useful hacks for JavaScript js类型判断的方法 基于html5 canvas 的客户端异步上传图片的插件,支持客户端压缩图片尺寸 Google Chrome 默认非安全端口列表 js判断类型的方法 博客园样式排版自定义 easyloader.js源代码分析 JQuery操作cookies jQuery插件的开发 jQuery 1.9 移除了 $.browser 的替代方法 Pretty Gmail GreasemonkeyScript jQuery之移除链接小插件 ASP.NET中关于验证控件和自定义弹出确认窗口的冲突问题 JQuery获取浏览器窗口的可视区域高度和宽度,滚动条高度 jQuery的选择器 园子里使用的jQuery.json
IIS字体文件添加MIME映射
iQingHan · 2015-11-06 · via 博客园 - iQingHan

在前端经常会做这样一件事情,页面会加载一些特殊的字体或者是图标文件,常用的比如:.woff、woff2、.ttf、.svg、.otf、.eot..。如果没有添加MIME映射会报404的错误,IIS错误信息如下:

HTTP 错误 404.3 - Not Found
由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。

解决方法:

添加MIME类型映射

直接在IIS面板中的 MIME类型 中添加对应的信息,具体类型信息可参考 W3CSchool MIME 参考手册
为了保险起见可在配置文件中添加MIME映射的信息:

<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".woff"/>
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
            <remove fileExtension=".woff2"/>
            <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
            <remove fileExtension=".ttf" />
            <mimeMap fileExtension=".ttf" mimeType="application/x-font-truetype" />
            <remove fileExtension=".svg" />
            <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
            <remove fileExtension=".otf" />
            <mimeMap fileExtension=".otf" mimeType="application/x-font-opentype" />
            <remove fileExtension=".eot" />
            <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        </staticContent>
    </system.webServer>
</configuration>

其他类型的MIME映射信息添加类似。