Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FontAwesome webfont files giving error 404 (Not Found) on Windows Server running IIS 7.5

Working on MVC5 app. Works like a charm on local dev box. Copied files to server and the fontawesome related stuff is not working. I'm getting these errors in the dev tools for Chrome...

fontawesome-webfont.woff2 Failed to load resource: 
       the server responded with a status of 404 (Not Found)
fontawesome-webfont.woff Failed to load resource: 
       the server responded with a status of 404 (Not Found)
fontawesome-webfont.ttf Failed to load resource: 
       the server responded with a status of 404 (Not Found)

Yes, the files are there on the server.

Server info: Windows Server 2008 R2 Standard; IIS 7.5.7600.16385

After much research, I've found several solutions online, in regards to adding MIME lines to web.config. There are several variations, but none of them seem to work. For example, for .woff, I've tried...

<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />

also

<mimeMap fileExtension=".woff" mimeType="application/font-woff" />

etc...

First I removed the items. For example...

<remove fileExtension=".woff" />

Any other suggestions? The screenshot will show Chromes debugger (404), also the IIS MIME entries and the web.config MIME section.

enter image description here

like image 263
WebDevGuy2 Avatar asked Oct 18 '25 03:10

WebDevGuy2


1 Answers

This solved that issue for me: Put the following in your system.webServer tags:

<staticContent>
  <remove fileExtension=".woff" />
  <remove fileExtension=".woff2" />
  <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
  <mimeMap fileExtension=".woff2" mimeType="font/x-woff" />
</staticContent>
like image 54
Kyle Avatar answered Oct 22 '25 01:10

Kyle