1

In my Controller I use

$this->_response->setRedirect($url);

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 – Muhammad Hasham Mar 12 '19 at 12:44
  • I tried but have the same error, in magento 1 i have no problems to go to this site.. – Andreja Vidovic Mar 14 '19 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... – Andreja Vidovic Mar 14 '19 at 10:18

Your Answer

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

Browse other questions tagged or ask your own question.