I am using zend framework in my one of the project.
I want to redirect a link www.example.com/xyz to www.example.com/pqr/lmn so I have added following link in index.php file
开发者_如何转开发$router = $frontController->getRouter();
$router->addRoute('newroutnae',new Zend_Controller_Router_Route_Static('/xyz/',array('controller' => 'pqr','action' => 'lmn')));
After doing a strange thing happened all the link in the page is showing www.example.com/xyz url only.
Can anybody help me out to resolve this issue.
Thanks in advance.
Try this, remove the slash at the start of /xyz/
$router = $frontController->getRouter();
$router->addRoute('newroutnae',
new Zend_Controller_Router_Route_Static('xyz/', array('controller' => 'pqr', 'action' => 'lmn')));
精彩评论