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 'http://hb.wpmucdn.com/fonts/fontawesome-webfont.woff2?v=4.7.0' from origin 'http://***....cloud***sapps.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://wordpress-138014-484892.cloudwaysapps.com' is therefore not allowed access. The response had HTTP status code 403."

https://monosnap.com/file/gUm7LJmjiX5NdF3W0U7fntFFYknO2W

https://monosnap.com/file/KqFrHURauhYi6OO1MZYaf9ephssvWe

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 "*"
</FilesMatch>

Please help.

  • Adam Czajczyk

    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,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.