error
CMS

Solution – Font icon not displaying on subdomains but works on parent site in WordPress

Solution – Font icon not displaying on subdomains but works on parent site in WordPress My rating: 5 out of 5

Problem: sometime Font icon (such as fontawsome icons) do not load on sub domains but they work fine on parent domain.

Please see below image for reference

error

you can also check your browser console for this error

the message mostly seen on console for such kind of problem is

Font from origin ‘http://’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://>’ is therefore not allowed access.

or

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxx. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Solution:

you can add few lines of code in your htaccess file to get rid of this issue.

<FilesMatch ".(ttf|otf|woff)$">
    Header set Access-Control-Allow-Origin "*"
</FilesMatch>font icon error solution After adding these in your htaccess your website will work fine. 

 

Leave a Reply

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