Fontawesome is being blocked from wpmu cdn.

On my site, assets are being loaded from wpmudev cdn and FontAwesome is being blocked by CORS policy. Getting the following error:

"Access to Font at '' from origin 'http://******' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access. The response had HTTP status code 403."

I'm 100% sure that the problem is not on my side as I can load the woff fonts from the same cdn if I disable hummingbird plugin. Also if it helps, this code is already present on the .htaccess file:

<FilesMatch ".(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"

Please help.

  • Adam Czajczyk
    • Support Gorilla

    Hello Rodrigo,

    I hope you're well today and thank you for your question!

    I have checked your site and the issue here is the way Font Awesome fonts are included/used on site. The font files, themselves, are not offloaded to WPMU DEV CDN. The stylesheet that calles them out, however, is using relative paths.

    When it's not "offloaded" to WPMU DEV CDN that relative path is within your site's install but when the stylesheet changes location (to WPMU DEV CDN) those paths then point to location on our CDN too - where there's no files, so they cannot be loaded.

    I realize that you can load these files "from original CDN" but the way WPMU DEV CDN works is different than for example CloudFlare: CloudFlare works "in front" of the site and on a DNS level while here we just "off load" optimized resources so they'd be served from our fast CDN infrastructure, kind of "behind" the site. I'm not sure if I explained it clearly so let me know please if I should explain it better.

    The bottom line is: the problem here are these relative paths. The simplest solution is to just disable WPMU DEV CDN in "Hummingbird -> Asset Optimization" settings. I did this (you can enable it back at anytime) already and these fonts are now loaded properly. Using WPMU DEV CDN is not obligatory and switching it off doesn't require disabling entire plugin.

    A permanent solution would require adjusting the stylesheet file that loads Font Awesome fonts and tweaking paths so instead of relative pats it would be using absolute ones. That would most likely mean creation of a child theme of a current theme as I believe it's a theme that's loading these fonts.

    If you have any follow up questions, let me know please.

    Kind regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.