开发者

Zend Framework URL rewire problem zend_route

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')));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜