Created
February 25, 2011 15:56
-
-
Save wheresalice/843983 to your computer and use it in GitHub Desktop.
webfont .htaccess rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checks to see if the user is attempting to access a valid file,