how to redirect the custom controller path to specific store name





2 Answers 2


You can try below code in your controller to set the redirect to your custom URL.

// or


// Do your process

Reference: Can you set a template for every action within a controller?

Hope it helps!!!

  • thanks it is redirecting but page is not loading with that id
    – Raghu
    Commented Sep 10, 2019 at 7:33
  • Have you tried $this->_redirect($url); in your controller? Also Mage::app()->getResponse()->setRedirct($url);
    – Sumit
    Commented Sep 10, 2019 at 7:37
  • no actually i am doing in controller like testurl.com/testmodule/index/testview/id/123 in test view funtion i am setting a template and loading page with current url id parameter
    – Raghu
    Commented Sep 10, 2019 at 7:42
  • 1
    yes i have tried this, along with this i have added Router concept, this is working well now, thanks
    – Raghu
    Commented Sep 16, 2019 at 6:24
  • 1
    no for my scenario this is ok
    – Raghu
    Commented Sep 16, 2019 at 6:30

In the controller action you need to write this line to redirect with current parameter (redirect inside your domain, not to an external website)

$this->_redirect('testname/index/index', $this->getRequest()->getParams());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.