I have a project which uses module directory based on custom routes not the default routes. The system loads each module's routes.ini files and add those routes into a Zend_Controller_Router_Rewrite router.
protected function _initRoutes() {
$this->bootstrap('FrontController');
$front = $this->getResource('FrontController');
$routes = Module_Loader::getInstance()->getRoutes();
$front->setRouter($routes);
$front->getRouter()->removeDefaultRoutes();
}
What i am trying to achieve here is to prepend the language code into the uri but chaining with Router_Rewrite is not possible. I have a route:
[routes]
;Index page
routes.core_index_index.type = "Zend_Controller_Router_Route_Static"
routes.core_index_index.route = "/"
routes.core_index_index.defaults.module = "core"
routes.core_index_index.defaults.controller = "index"
routes.core_index_index.defaults.action = "index"
routes.core_index_index.defaults.frontend = "true"
routes.core_index_index.defaults.langKey = "route_index_page_description"
routes.core_index_index.defaults.localization.enable = "true"
Basically i want the url to look like: http://myhost.com/en/ or http://myhost.com/ which should both direct to this index action of the the homepage controller in the core module.
I can have this appended to the routing rule above as "/([en/]*)" but i don't want the module to care about handling such system-related functionalities.
Is this possible?
Thanks.