Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having trouble getting font files to be returned by my IIS. The URLs are correct, the mime-types are set correctly, but I'm still getting 404's. Other static files like JS, CSS, LESS are all returned as expected but the dang font files won't return.

This is for a .NET 4.5 project running MVC4 if that helps.

If I move the font files outside of the application, the files are returned correctly. It is almost as if there is some setting within the .NET application that is preventing the font files from being retrieved.

Thanks in advance for any help and let me know if additional information would be helpful.

share|improve this question

1 Answer 1

You probably need to add a MIME type with the file extension of the font.

IIS Can't Serve Certain File Extension

Edit: No, you clearly don't if you've set them already. Incidentally, MIME types can be set on a per-app basis, so you might just want to check the MIME types haven't been overridden in the web.config file. (Searching for the file extension in the web.config file might also net something of interest, or not)

share|improve this answer
    
I mentioned in the question that the MIME types are already set. I've tried different mime types to no avail. Plus, the server will return the font file when it is moved outside of the application. There are no overriding mime type settings in any web.config on the files either. –  Chris Peterson May 16 at 3:07
1  
You did indeed, sorry, I only spot it when I see caps! Using IIS 7.5, you might be able to use Failed Request Tracing to understand which component's preventing the download, and how/why. Install the Tracing feature from Server Manager, then enable it at the Site level (in the Actions pane), then create a rule in the application. Out of interest, what's the file extension for the fonts? –  TristanK May 16 at 4:22
    
It is actually blocking .woff, ttf, svg, and eot. I'll see if I can' get more debug info. –  Chris Peterson May 16 at 5:21
    
I followed your advice and added the logging. I spit out this huge blob of XML. I'm not sure what I'm supposed to be looking for. Would you mind taking a look? dl.dropboxusercontent.com/u/39382497/fr000001.xml –  Chris Peterson May 16 at 5:38
    
You can usually just double-click them and that'll format them as a web page using the XSL in the directory. Good news/bad news: there's nothing specifically in IIS blocking it, it's something within the application (i.e. code loaded into the ManagedPipelineHandler) or MVC / routing framework. The BlockViewHandler could be implicated, but it's not instantaneous on entry to that module. There's possibly a system.web setting somewhere causing the problem, but that's the extent of my knowledge. You might find StackOverflow is a better shot for MVC-related questions. –  TristanK May 18 at 22:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.