开发者

Zend Framework URL rewire problem zend_route

开发者 https://www.devze.com 2023-01-16 02:41 出处:网络
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

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

精彩评论

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

关注公众号