Question

If i have a url such as this http://example.com/controller/action every thing works find. as expected. However i need to deploy this and in deployment things change a bit to htttp://deploy.com/stuff/pile/controller/action is there any way i can control this in zend.

Thanks in advance.

Was it helpful?

Solution

Add this route to your Bootstrap:

protected function _initRoute() {
    $front = Zend_Controller_Front::getInstance();
    $router = $front->getRouter();
    $router->addRoute(
        'prefix_route',
        new Zend_Controller_Router_Route('stuff/pile/:controller/:action',
            array('controller' => $front->getRequest()->getControllerName(),
                  'action' => $front->getRequest()->getActionName())));
    );
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top