Hi,
I've currently urls like http://example.com/index/index/lang/EN/content/5. I want to remove controller and action if they both are index, like http://example.com/lang/EN/content/5. To do that i overrided url view helper and if both controller and action are index removed them. In error controller i wrote:
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$request = $front->getRequest();
$response = $front->getResponse();
$current_controller = $request->getParam('controller');
$current_action = $request->getParam('action');
$request->setParams(array($current_controller=>$current_action,'controller'=>'index','action'=>'index'));
Zend_Controller_Front::getInstance()->getDispatcher()->dispatch($request, $response);
If a controller and action can't be found, simply it's redirecting to the index/index and i'm setting the undefined controller as a parameter which is 'lang' here. But the problem is however it is setting 'lang' as a parameter, after dispatching again it disappears. So my url turns to /index/index/content/5. Do you know any solution to that or do you have any other suggestions to remove default controller and actions from the url?