We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51553
    • 18 Posts
    Hi all!

    Here's a stumper for ya!

    Just created a multi-context setup, where several subdomains are separated into different contexts within MODX...
    I downloaded the FontAwesome font set for my website (this problem I imagine is not limited to just these files though)
    I created Content Types for each of the file types with the appropriate header information.
    I created individual Static Resources within Context A of my site, pointing to each font file
    I replaced all of the references to these font files in my template with [[~#? &scheme=`full`]] for each of the links (# being replaced with the id of course)

    When I cleared my cache and loaded the page on Context B, it gave me an error in my Firefox Console when trying to load the font files:
    "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at *****. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."

    I started to look into Cross-Origin Resource Sharing and thought that my brain could handle it, but I quickly learned that I was wrong haha

    Anybody have any thoughts?

    This question has been answered by c5j4k5. See the first response.

      ---
      Chris Holowatyj
      Keddy & Associates - Web Design Professionals
      https://keddyandassociates.com
      [email protected]
    • discuss.answer
      • 51553
      • 18 Posts
      Just solved my own question LMAO

      If using cross-context links where the contexts are different sub-domains, if you get a CORS Error in your browser console, try adding the following line of code to your .htaccess file (worked for me!) :

      Header set Access-Control-Allow-Origin "*"
        ---
        Chris Holowatyj
        Keddy & Associates - Web Design Professionals
        https://keddyandassociates.com
        [email protected]