Quantcast
Channel: MageDev » magento development
Viewing all articles
Browse latest Browse all 2

Magento redirect

$
0
0

Using redirection in Magento controllers is not a rocket science thanks to Mage_Core_Controller_Varien_Action::_redirect() and Mage_Core_Controller_Varien_Action::_redirectUrl() methods. When trying to create redirection in CMS page (to prevent not logged-in users from accessing it) I found follwing code very helpful:

Mage::app()->getFrontController()
           ->getResponse()
           ->setRedirect('http://your-url.com');

The setRedirect() method accept two parameters – target URL and redirect code (302 by default).


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images