Magento 1.9 – Redirect to External URL from Template and Controller

externalmagento-1.9redirecttemplate

How can I redirect customers to external urls i.e. other websites from template and controller in magento 1.9? Like Mage::app()->getResponse()->setRedirect('https://payment.api.com'); exit;. It is not working for external urls in template.

Best Answer

Just add the another function sendResponse() to your code.

Mage::app()->getResponse()->setRedirect('https://payment.api.com') ->sendResponse();

then add return ;

Mage::app()->getResponse()->setRedirect('https://payment.api.com') ->sendResponse();

return ;

Related Topic