Windows – IIS8.5 woff2 Mimetype 404 on some pages

iisiis-8.5web-serverwindows

Added the woff2 MimeType at server level on an IIS8.5. The woff2 fonts are loaded on the home page and some pages, however doesn't load on some other pages. Any ideas on what could be causing this ?

The site is a wordpress site.

Best Answer

I had this same problem on my IIS 8.5 server. I ended up adding the following to my Web.config file:

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

If you already have a section in your Web.config file you should just add the tag and contents to that section. The same goes for if you already have a section in your section: just add the and pairs like the example above.

One other note, you may find that the server needs a type of application/x-font-woff or even possibly just font/woff and font/woff2.

Here's a good blog post from Rick Strahl showing other methods of achieving the same results with IIS Manager and the command line.

Related Topic