Last Updated: February 25, 2016
·
577
· arnonate

Serving @font-face icon font across domains

Turns out if you want to serve font files across domains that a header adjustment needs to be set on the domain which is hosting the font. For example, I have an icon font hosted at mydomain.com but I want to display the font on anotherdomain.com. Some browsers don't like this UNLESS you explicitly set a header for the hosting domain. Crack open the .htaccess file on the hosting domain and add this little snippet...

<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

Yay! Now go eat a crumpet and enjoy being awesome...