Font-Face CSS not working with CDN cross domain

By | January 4, 2014

Hello Friends, are you facing problem as font-face not working properly when style sheet / font loaded from hosted CDN domain or any other Cross Domain, However It is work fine when style sheet on the same domain.

Main reason for font-face not working is your Apache Server configuration setting that not enable for use font-files with cross domain.

You can enable it by just adding following few line code in your .htaccess file that are at your CDN domain hosted root directory.

#
# enable cross-site use of font-files


Header set Access-Control-Allow-Origin "*"


Header set Access-Control-Allow-Origin “*” allow all cross domain site to use this CDN hosted font, but you can exactly specify which domain should allow to access by replace * with allowed site url.

Like

Header set Access-Control-Allow-Origin "http://allowsite.com"

Leave a Reply

Your email address will not be published. Required fields are marked *