Php Phalcon路线组404不工作
我有网址:Php Phalcon路线组404不工作,php,routes,phalcon,Php,Routes,Phalcon,我有网址: site.com/sdfsd-404正在工作 site.com/ru/page/sdfasdfasfasdfsad-不工作,我被重定向到主页 $router->add('/', array( 'module' => 'frontend', 'controller' => 'index', 'action' => 'index', 'lang' => 'md', ))->setName('default'); $router->
site.com/sdfsd
-404正在工作
site.com/ru/page/sdfasdfasfasdfsad
-不工作,我被重定向到主页
$router->add('/', array(
'module' => 'frontend',
'controller' => 'index',
'action' => 'index',
'lang' => 'md',
))->setName('default');
$router->add('/{lang:[' . $langsDefined . ']{2}+}(/?)', array(
'module' => 'frontend',
'controller' => 'index',
'action' => 'index',
'lang' => 1,
))->setName('default_lang');
我怎样才能解决这个问题
$router = new \Phalcon\Mvc\Router(false);
$router->notFound(array(
"controller" => "Notfound",
"action" => "index"
));
方法
NotFound
不工作。我得到重定向到主页 请注意名称空间,您可以这样尝试:
$router->notFound(array(
"module" => "frontend",
"controller" => "Notfound",
"action" => "index"
));