In my Controller I use


I got this error.

Access to XMLHttpRequest at 'URL' (redirected from 'myWebStoreUrl') from origin 'myServerUrl' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

What should I do?

  • please check this magento.stackexchange.com/questions/252236/… it might help you Mar 12, 2019 at 12:44
  • I tried but have the same error, in magento 1 i have no problems to go to this site.. Mar 14, 2019 at 10:18
  • $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $redirect = $objectManager->get('\Magento\Framework\App\Response\Http'); $redirect->setRedirect($url); I tried like this, same error... Mar 14, 2019 at 10:18


Your Answer

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

Browse other questions tagged or ask your own question.