我想匹配这样的 urlhttp://localhost/sunnetwap/1-hot
并重写为 this
http://localhost/sunnetwap/?c=1&s=hot
。在我的 Bootstrap 和 _initRoutes 函数中,我写道:
$frontController = Zend_Controller_Front::getInstance();
$route = new Zend_Controller_Router_Route_Regex(
"([0-9]*)-([a-z]*)",
array(
'module' => 'default',
'controller' => 'index',
'action' => 'index'
),
array(
1 => 'c',
2 => 's'
));
$frontController->getRouter()->addRoute('home',$route);
但它不起作用。你能帮助我吗?