Domain Mapping and CORS origin Issue

I have a problem with icons on one of my sub-domains which I've that mapped to bld******sale.com. I suddenly noticed that the search icon on the header menu turned to U symbol and other icons turned to some other character. I don't know how to fix this. I use Divi theme on the subdomain. Here is the subdomain: bld.dev*****ated.com

There is the following error in browser console:
Access to Font at 'http://da8dsugrl65ch.cloudfront.net/devintegrated.com/core/admin/fonts/modules.ttf' from origin 'http://bldwholesale.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://bldwholesale.com' is therefore not allowed access. The response had HTTP status code 403.

I've tried to fix this via htaccess Access-Control-Allow-Origin rules, but it doesn't help.

  • Nastia
    • Support Rock Star

    Hello Louis Akporiaye

    I trust you're doing well!

    The font is uploaded to CloudFlare and the browser doesn't recognize it. Unfortunately, I couldn't access your site with FTP credentials you've shared. Would you please try adding this rule to the .htaccess file:

    Header add Access-Control-Allow-Origin "http://maped-domain.com"

    Replace the http://maped-domain.com, with the domain that is mapped on a subsite

    After the line below is added, please purge cache from the CloudFlare server. Details on Purge Everything is here:
    https://support.cloudflare.com/hc/en-us/articles/200169246-How-do-I-purge-my-cache-

    Also, I would suggest to re-try these lines and purge the CloudFlare cache if your server is using Apache:

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

    If your server is on NGNIX, please add this to config file:

    location ~ \.(ttf|ttc|otf|eot|woff|font.css|css)$ {
               add_header Access-Control-Allow-Origin "*";
    }

    Let us know how it went!

    Kind regards,
    Nastia

  • Louis Akporiaye
    • WPMU DEV Initiate

    Hello Nastia,

    Kindly note that my website is not on cloudflare.

    I've added the lines as advised, but the problem persists.

    My FTP details is working; I have just used it now.

    Let me know how to send you the FTP access so you can take a look yourself.

    Thank you.

  • Louis Akporiaye
    • WPMU DEV Initiate

    Hi Nastia,

    I found this on one of your forum posts:

    Hi Randy Blodgett ,

    Hope you're doing well today!

    I would like to apologize, but I made a mistake in my test which led me to give a incorrect information. Actually, Cloudfront is the CDN used by WPMUDEV to store the files, when you enable the option "Store my files on the WPMU DEV CDN" in the Minification section (Hummingbird -> Minification):

    Here's the post link: https://premium.wpmudev.org/forums/topic/performance-report-issues

    The cloudfront issue is with Hommingbird plugin.

    Please check.

    Thank you

  • Dimitris
    • Support Star

    Hello there Louis Akporiaye,

    hope you're doing good today! :slight_smile:

    I understand that this was an issue due to the cloudfront URL, so I first tried to replicate in a test site of mine. WPMUDEV CDN was active in network admin options of HummingBird, then I installed and activated Divi theme in the subsite that's mapped, re-run Minification and all icons are being served from Cloudfront without any issue.

    I then inspected your website and noticed that both original and mapped domain are serving these icons without any problem too, but I can see that you've disabled the WPMU DEV CDN.

    Did that resolve the issue? If so, are we allowed to activate it back and further troubleshoot this?

    I was also able to connect via FTP, I guess Nastia was having some local issues at that time, and I can see that .htaccess rules proposed above are well in place. :slight_smile:

    Warm regards,
    Dimitris

  • Louis Akporiaye
    • WPMU DEV Initiate

    Hello Dimitris,

    The issue has been resolved. I did deactivate the WPMUDEV CDN but it did not solve the problem until I remove minification of some of the files on each subsite.

    The issue is with minification.

    I think it's better to leave it this way as the site is already live.

    Thank you.
    Louis.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.