I have made Magento controller that redirects to url, but for some reason url is wrong.
My controller:
public function indexPostAction()
{
// Do stuff here
$this->_redirect('module/controllername');
}
This controller redirects to url module/controllername/indexPost, but I have redirected it to module/controllername which is my index page of my module. Why it is not redirecting to correct address?
That redirect will redirect you to http://www.yourstore.com/module/controllername which is controlled by the
indexActionfunction of thecontrollernamecontroller. What does theindexActionfunction do? If you just want it to display the content of the layout, so you would do that with