Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding filetype to IIS7 with web.config

I want to allow my website to serve up .WOFF files. Initially I tried a command line prompt in my installer but it didnt seem to work then I found out I could add this in web.config. Unfortunately when I do this the server stops serving up most other file types (css / js etc)

What is happening?

<system.webServer>
  <staticContent>
    <mimeMap fileExtension=".woff" mimeType="application/octet-stream" />
  </staticContent>
</system.webServer>
like image 827
Chris Avatar asked Mar 19 '26 02:03

Chris


1 Answers

I had the exact same problem in the past and it was due to the fact that the ".woff" extension was already mapped in the machine.config, causing a silent conflict.

Try using the "remove" tag just before the "mimeMap" tag, like this:

<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/octet-stream" />

That should fix your problem, at least it did for me.

like image 147
Matteo Mosca Avatar answered Mar 20 '26 16:03

Matteo Mosca