Dowemo
0 0 0 0

Original source: http://blog. 163. com/ny_lonely/blog/static/18892427320151265526367/.


A specific font ( *. Woff, *. Svg ) is often encountered during the process of writing code, which will be returned when the font is loaded.

Failed to load resource: the server responded with a status of 404 ( not found ).

Cause is that the default on iis isn't to add mime types for *. Woff, *. Svg files, so when the client requests such a file, it's 404.

So we only need to be under our website. Mime type Just add the type of file.

  • Woff/x-font-woff
  • . Woff2 application/x-font-woff
  • Svg image/svg + xml

In addition, in mvc, there are 404 problems when the get request font is set after the above mime type, which needs to be used in our web project 's config. System. Web server. The following code is added to the node to support


<staticContent>
<removefileExtension=".woff"/>
<mimeMapfileExtension=".woff"mimeType="application/x-font-woff"/>
<removefileExtension=".woff2"/>
<mimeMapfileExtension=".woff2"mimeType="application/x-font-woff2"/>
<removefileExtension=".ttf"/>
<mimeMapfileExtension=".ttf"mimeType="application/x-font-truetype"/>
<removefileExtension=".svg"/>
<mimeMapfileExtension=".svg"mimeType="image/svg+xml"/>
<removefileExtension=".otf"/>
<mimeMapfileExtension=".otf"mimeType="application/x-font-opentype"/>
<removefileExtension=".eot"/>
<mimeMapfileExtension=".eot"mimeType="application/vnd.ms-fontobject"/>
</staticContent>





Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs