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



<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/" />

Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs