Here I have some code in my .htaccess file

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"

Header set X-UA-Compatible "IE=edge"

# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe? 
 Header unset X-UA-Compatible


on the first line i have the Header set Access-Control-Allow-Origin "*" and it does not seem to be working for any browser except for chrome. I tried using this in my root .htaccess file as well as .htaccess file in app folder. Is there something i am doing wrong? Also I should add that I am using a css @font-face for these google fonts.

1 Answer 1


You will need to create a simple module for this or extend one you have previously made.


<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="1.0.0"/>


 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__);


<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd">
        <policy id="font-src">
                <value id="google-services" type="host">www.googleservices.com</value>
                <value id="google" type="host">*.google.com</value>
                <value id="gstatic" type="host">*.gstatic.com</value>

After you have implemented this this should fix your font issues, please refer to Magento 2 DevDocs - Content Security Policies for further information

  • Works fine. Thanks.
    – Dylan T
    Sep 10, 2020 at 21:22
  • @DylanT glad to hear Sep 13, 2020 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.