In the process of writing the front-end code, you often encounter the use of a specific font (*.WOFF,*.SVG), at which time the request is returned when the font is loaded
Failed to load Resource:the Server responded with a status of 404 (not Found).
The reason is that, by default, there is no MIME type added to the *.woff,*.svg file on IIS, so when the client requests such a file, it gets 404.
So we just need to add the type of the file to the MIME type under our corresponding website.
- . Woff Application/x-font-woff
- . woff2 Application/x-font-woff
- . svg Image/svg+xml
In addition, in MVC, when you set the above MIME type, the GET request font will appear with a 404 problem, this time we need to add the following code to the system.webserver node of config in our web project to support
<staticContent>
<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= mimetype= />
<remove fileextension=< Span class= "ATV" > "EOT" />
<mimemap fileextension= "EOT" mimetype= />
</STATICCONTENT>
IIS cannot load a font file (*.woff,*.svg) workaround