views:

46

answers:

1

Hello,

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.

A: 

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