webfont .htaccess rules
# ---------------------------------------------------------------------- | |
# Webfont access | |
# ---------------------------------------------------------------------- | |
# allow access from all domains for webfonts | |
# alternatively you could only whitelist | |
# your subdomains like "sub.domain.com" | |
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$"> | |
<IfModule mod_headers.c> | |
Header set Access-Control-Allow-Origin "*" | |
</IfModule> | |
</FilesMatch> | |
# webfont mime types | |
AddType application/vnd.ms-fontobject eot | |
AddType font/truetype ttf | |
AddType font/opentype otf | |
AddType application/x-font-woff woff | |
# webfonts and svg: | |
<IfModule mod_deflate.c> | |
<FilesMatch "\.(ttf|otf|eot|svg)$" > | |
SetOutputFilter DEFLATE | |
</FilesMatch> | |
</IfModule> |
This comment has been minimized.
This comment has been minimized.
You'll probably never see this but this just totally saved my ass. <3 I've been trying to get webfonts to work on a project for 3 days with no luck ,but this worked like a charm. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
For IE10, instead of
application/vnd.ms-fontobject
,font/eot
seems to be what Google Font API uses for theeot
mime type.