[IIS] File Formats (Fonts) Failing to Load on IIS Server

While deploying an IIS service recently, I noticed that some .ttf, .otf, .woff and other font files were not being loaded, even though js, css, images and other files loaded successfully. The reason is that IIS cannot serve files that don’t have a default MIME mapping.

The solution is simple – add the corresponding MIME type mappings. You can add them directly in the IIS panel under MIME Types. For specific type information, refer to the W3CSchool MIME Reference: http://www.w3school.com.cn/media/media_mimeref.asp

MIME mappings for font files:

1
2
3
4
5
6
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
<mimeMap fileExtension=".ttf" mimeType="application/x-font-truetype" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".otf" mimeType="application/x-font-opentype" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
Licensed under CC BY-NC-SA 4.0