What mime type should WOFF fonts be served as?
I am serving truetype (ttf) fonts as font/truetype
and opentype (otf) as font/opentype
, but I cannot find the correct format for WOFF fonts.
I have tried font/woff
, font/webopen
, and font/webopentype
, but Chrome still complains:
"Resource interpreted as font but transferred with MIME type application/octet-stream."
Anybody know?
As of February 2017, RFC8081 is the proposed standard. It defines a top-level media type for fonts, therefore the standard media type for WOFF and WOFF2 are as follows:
Reference for adding font mime types to .NET/IIS
via web.config
via IIS Manager
There is no
font
MIME type! Thus,font/xxx
is ALWAYS wrong.IIS automatically defined .ttf as application/octet-stream which seems to work fine and fontshop recommends .woff to be defined as application/octet-stream
For all Solution index.php remove form url and woff file allowed. for write below code in .htaccess file and and make this alternation to your application/config/config.php file: $config['index_page'] = '';
For only Linux hosting server. .htaccess file details
NGINX SOLUTION
file
or
add
remove
REFERENCES
RFC @02.2017
https://tools.ietf.org/html/rfc8081#page-15
https://www.iana.org/assignments/media-types/media-types.xhtml
Thanks to Mike Fulcher
http://drawingablank.me/blog/font-mime-types-in-nginx.html