controller redirect url with language
-
01-01-2021 - |
Question
I have a multi language web, and I need to redirect from the controller to the actual language of the web.
So $this->_redirectURL('/foo/');
now is redirecting to example.com/foo/
but I need to redirect to example.com/en/foo/
How to introduce the code language in the url redirection?
Solution
Try this:
$url = Mage::getUrl('', array('_direct'=>'foo'));
$this->_redirectUrl($url);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange