• Resolved ULinn

    (@ulinn)


    Hello,

    my theme uses fontawesome. If I access the main site, everythings perfect, but if I acces another domain defined in the multidomain-plugin, the fa-icons are not shown.

    In the console I see a Cross-Origin-Error.

    I already found out, that using
    Header set Access-Control-Allow-Origin "*"
    in the .htaccess could solve this.

    It does work, but I would like not to allow “*” but only those domains used in multidomain. I tried to replace the “*” with “https://www.mydomain.de/”, but now the Cross-Origin-Error is back again.

    Do you have any hint how to solve this?

    Best regards

    Uli

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author matthias.wagner

    (@matthiaswagner)

    Thread Starter ULinn

    (@ulinn)

    Hi Matthias,

    its always good to know, what too look for. I did search CORS in this forum and several combinaions with cors at goole, but everything I found, did not work.

    But your hint brought me to this:

    # ----------------------------------------------------------------------
    # Allow loading of external fonts
    # ----------------------------------------------------------------------
    <FilesMatch "\.(ttf|otf|eot|woff)$">
        <IfModule mod_headers.c>
            SetEnvIf Origin "http(s)?://(www\.)?(google.com|staging.google.com|development.google.com|otherdomain.example|dev02.otherdomain.example)$" AccessControlAllowOrigin=$0
            Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
            Header merge Vary Origin
        </IfModule>
    </FilesMatch>

    First of all, I did enter only the domain on wich was mentionned in the consloes error-message (the “main domain”) but this did not solve the poblem.

    But: Entering all domains that are listet in multidomain solved it. I don’t understand why, but the main thing is: it works!

    Probably this information will also be helpfull for other users.

    Best regards

    Uli

    Plugin Author matthias.wagner

    (@matthiaswagner)

    great to hear and thank you for the code 🙂

    matt

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Activating CORS’ is closed to new replies.