In my module, after execution of my script, I need to make a redirect to a page with a query string in the URL.
Here is what I have:
$redirectUrl = 'http://magento.local/en_en/shop/index';
$redirectArgs = array('test' => '1');
$this->_redirect($redirectUrl, $redirectArgs);
I also tried:
Mage::app()->getFrontController()->getResponse()->setRedirect($redirectUrl, $redirectArgs)->sendResponse();
Both methods throw an error: There has been an error processing your request
What I expect is to be redirected to http://magento.local/en_en/shop/index?test=1
Does anyone know how I can achieve that?
Edit:
As suggested, I have tried:
$redirectUrl = 'http://magento.local/en_en/shop/index?test=1';
Mage::app()->getResponse()->setRedirect($redirectUrl);
No error, but nothing happens. I am not in a controller.
Edit 2:
I ended up using:
$redirectUrl = 'http://magento.local/en_en/shop/index?test=1';
Mage::app()->getResponse()->setRedirect($redirectUrl)->sendResponse();
This works as expected! Thank you.