Production Environment: Hostgator, shared

My theme's .css files refer to .eot / woff / .ttf ... etc font files. These 
are loading fine via development server.

But after deploying on the production server, icons did not load and the 
browser console showed Cross Origin Request Services not allowed error 
(CORS).

If someone else too runs into this problem then it can be solved by adding 
the following lines to the *.htaccess* file that is placed *in the same dir 
as the font files*:

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



The * wild card allows requests from any domain. Of course it can be set to 
www.example.com to allow access from only www.example.com hosted HTML.

The following page was helpful in giving this information:
http://red-team-design.com/firefox-doesnt-allow-cross-domain-fonts-by-default/

More detail on CORS:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

Hope this helps someone.

Cheers!
Pushkar



-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to