【发布时间】:2017-10-25 12:59:56
【问题描述】:
正在开发 MVC5 应用程序。像本地开发盒上的魅力一样工作。将文件复制到服务器并且与字体相关的东西不起作用。我在 Chrome 的开发工具中遇到这些错误...
fontawesome-webfont.woff2 Failed to load resource:
the server responded with a status of 404 (Not Found)
fontawesome-webfont.woff Failed to load resource:
the server responded with a status of 404 (Not Found)
fontawesome-webfont.ttf Failed to load resource:
the server responded with a status of 404 (Not Found)
是的,文件在服务器上。
服务器信息:Windows Server 2008 R2 Standard; IIS 7.5.7600.16385
经过大量研究,我在网上找到了几个关于将 MIME 行添加到 web.config 的解决方案。有几种变体,但它们似乎都不起作用。例如,对于 .woff,我尝试过...
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
还有
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
等等……
首先我删除了这些项目。比如……
<remove fileExtension=".woff" />
还有其他建议吗?屏幕截图将显示 Chrome 调试器 (404)、IIS MIME 条目和 web.config MIME 部分。
【问题讨论】:
-
抱歉,移至下面的答案以使其更具可读性。
标签: asp.net-mvc iis iis-7.5 font-awesome mime