Set mime types for web fonts in IIS

A typical @font-face declaration includes a .eot file, a .svg file, a .ttf file and a .woff file. If your IIS does not serve any of the previous file types, you need to set the appropriate mime type.

Simply add the following MIME type declarations via IIS Manager (HTTP Headers tab of website properties):

.eot   application/vnd.ms-fontobject
.ttf   application/octet-stream
.svg   image/svg+xml
.woff  application/x-woff

If you do not have access to the IIS Manager, you can add these declarations in your Web.config file, in the <system.webServer> section.

<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
    </staticContent>
</system.webServer>

Update: These settings will help you if the Font Awesome fonts are not showing in IE 9 or 10.

Comments

  1. Thanks for sharing information about mime-type. I faced same issue with linux server. can you help me out how to set mime-type in linux server?

  2. If you want to set custom mime types in Apache, I think you need to edit your .htaccess file.
    Check this thread on stackoverflow, it might be helpful. http://stackoverflow.com/questions/13847234/apache2-server-mime-types

  3. .ttf and .eot both have “application/octet-stream” in IIS, so should I change it to these values?

  4. When using Linux Apache for your web site, some configurations require you to add a new MIME type to allow the server to deliver Hyprecosm applet (.hcvm) files. This article describes how to add a new MIME type using Apache.

    Details : http://www.hypercosm.com/support/howto6.html

  5. @Harry
    I would recommend to use the more specific “application/vnd.ms-fontobject” for .eot files.

    The MIME type “application/octet-stream” is a generic type and used is to indicate binary data that does not have a more specific, assigned MIME type.
    In practice it is often used as the default MIME for binary, non-text data (and other unrecognized subtypes) that should be downloaded to a file.

    See here for more details: http://www.rfc-editor.org/rfc/rfc2046.txt

  6. Thank You. Its really help me. Thx again.

Speak Your Mind

*


*