解决Web部署 svg/woff/woff2字体 404错误
最近项目中用到了fontawesome-webfont.svg等字体。部署项目后,发现没有<,+等符号,字体也不对,发现浏览器总是报找不到woff2字体的错误。​

ASP .NET 404 Not Found fontawesome-webfont.woff?v=4.0.3-LMLPHP

如上图所示,源代码确实有fontawesome-webfont.woff2,后来上网查了,是VS2013没配置mine类型,

可配置web.config更方便,在web.config文件中配置如下:

<system.webServer>
<staticContent>
<remove fileExtension=".woff2"/>
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
</staticContent>
</system.webServer>

ASP .NET 404 Not Found fontawesome-webfont.woff?v=4.0.3-LMLPHP

主要参考stack overflow上的:

ASP .NET 404 Not Found fontawesome-webfont.woff?v=4.0.3-LMLPHP
https://stackoverflow.com/questions/24104736/networkerror-404-not-found-fontawesome-webfont-woffv-4-0-3

配置mine类型可参考:
http://www.webkaka.com/blog/archives/iis7-config-the-environment-for-font-awesome.html
http://www.cnblogs.com/hanwen/p/4212622.html

05-11 18:23