Monday, December 9, 2013

Font-face not working in Firefox in case of a different domain...

We had a website that is accessible through 2 separate domains, but on one of them the web fonts didn't work at all in Firefox.

This is because of strict file origin rules in Firefox, but adding the web font types to your .htaccess solves the problem.

 # BEGIN REQUIRED FOR WEBFONTS  
 AddType font/ttf .ttf  
 AddType font/eot .eot  
 AddType font/otf .otf  
 AddType font/woff .woff  
 <FilesMatch "\.(ttf|otf|eot|woff)$">  
   <IfModule mod_headers.c>  
     Header set Access-Control-Allow-Origin "*"  
   </IfModule>  
 </FilesMatch>  
 # END REQUIRED FOR WEBFONTS  

Source: http://stackoverflow.com/questions/2856502/css-font-face-not-working-with-firefox-but-working-with-chrome-and-ie