Zend Routing:: How I can send all request that going to application-> IndexController to application->module->store->IndexController

StackOverflow https://stackoverflow.com/questions/3022164

  •  26-09-2019
  •  | 
  •  

Question

How I can send all request in zend project to my default module controller (without use .access files).

Now it going to application->IndexController, Instead I need that every request will go to application->module->store->IndexController.

I try this:

public function indexAction()
{
       $this->_forward('index','index','store');
}

Its works, but url in web browser http://localhost/mystore/public/ not change to http://localhost/mystore/public/store/

Thanks,

Yosef

Was it helpful?

Solution

Try this:

public function indexAction()
{
    $this->_redirect('index','index','store');
}

Looking forward, probably the controller plugin handling automatically all the redirects will be better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top