I tried

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

and tried for js cross orign from htaccess

<FilesMatch "\.(js)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> in the .htaccess. but I still have the Cors error. Does anyone know how to fix it?

  • are you setting up Magento with Nginx ? – Aditya Shah Sep 28 '18 at 14:10

You can also set the cross-origin in app/etc/env.php by changing the following parameter.

  'x-frame-options' => 'CROSS-ORIGIN',

after changing flush your magento cache

php bin/magento c:f


  • thank you @Rizwan but still the same error – Borche Glafche Sep 28 '18 at 14:54
  • Can you add your error in question. – Rizwan Khan Sep 28 '18 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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