2010-09-13 99 views
1

我在我的項目中使用了zend框架。Zend Framework URL rewire問題zend_route

我想重定向鏈接www.example.com/xyz到www.example.com/pqr/lmn在index.php文件

$router = $frontController->getRouter(); 
$router->addRoute('newroutnae',new Zend_Controller_Router_Route_Static('/xyz/',array('controller' => 'pqr','action' => 'lmn'))); 

所以我增加了下面的鏈接做一件奇怪的事情後,發生在頁面中的所有鏈接僅顯示www.example.com/xyz url。

任何人都可以幫我解決這個問題。

在此先感謝。

回答

0

試試這個,取出斜槓的/xyz/

$router = $frontController->getRouter(); 
$router->addRoute('newroutnae', 
      new Zend_Controller_Router_Route_Static('xyz/', array('controller' => 'pqr', 'action' => 'lmn'))); 
開始