IIS8.5 Won’t Serve Font Files

iis-8.5

For some reason my IIS won't return any font files. They all return as 404s. I have verified the URLs are correct and the MIME types are correct. The font files are currently inside of a .NET 4.5 project using MVC4. When I move the files outside of the project, into the server's root directory, it serves the files up fine. I have verified there aren't any overrides happening in the project's web.config to how the file extensions are handled.

So far this is happening for .TTF, .EOT, .SVG, and .WOFF files. Other static files, in the same directory, are returned fine. Is there some setting in IIS8.5 that prevents the font files from being returned?

I have attached a log file which was generated by the failed request tracking.

https://dl.dropboxusercontent.com/u/39382497/fr000001.xml

Best Answer

This issue seems to have fixed itself through the course of working on the project. Andrew Morton provided some excellent trouble shooting steps for anyone else having similar issues. I'll provide quick list:

  • Verify the correct MIME type is being used by the server. Using IIS Manager > Server > Project > MIME Types. Here are the list of MIME types that are working for me:

    • .eot = application/vnd.ms-fontobject
    • .svg = image/svg+xml
    • .ttf = application/octet-stream
    • .woff = application/x-font-woff
  • If That doesn't work verify the web server has permissions on the project folder and the folder storing the files. Following a tutorial will help a lot.

  • Futher debugging using a tool such as ProcessMonitor will help narrow down more stubborn server issues.

Hope this helps someone.