你好,对不起,我的英语。
我的站点结构:
https://site.ru/category_1/.../category_N/post.htmlroutes.php:
$router = new Phalcon\Mvc\Router();
$router->notFound(array(
'controller' => 'index',
'action' => 'error404',
));
$router->add(
'/', array(
'controller' => 'index',
'action' => 'index'
)
);
$router->add(
'/{uri:[a-zA-Z0-9\-\/\.]+}', array(
'controller' => 'index',
'action' => 'index',
)
);
$router->add(
'/sitemapsyswrub7g5ox6mtz2tbplwiu6yduox6m.xml', array(
'controller' => 'index',
'action' => 'sitemap'
)
);
return $router;1)首先检查site.ru/sitemapsyswrub7g5ox6mtz2tbplwiu6yduox6m.xml
2)下一步检查帖子。
Uri传输到控制器/操作。
控制器查看$uri并加载post。
3)下一步检查主页。在htaccess文件中,site.ru/index.php、site.ru/index.html和site.ru/index.htm已经重定向到site.ru,它可以工作。但我有个问题。如果url:
site.ru/blabla_然后phalcon显示错误:
BlablaController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('BlablaControlle...', 2)
#1 [internal function]: Phalcon\Dispatcher->_dispatch()
#2 [internal function]: Phalcon\Dispatcher->dispatch()
#3 /home/srv/http/project/site.ru/public/index.php(23): Phalcon\Mvc\Application->handle()
#4 {main}如果url:
site.ru/blabla_.那好吧,works error404。
帮助为error404建立正确的路由。
发布于 2017-04-11 00:06:05
url "sitemapsyswrub7g5ox6mtz2tbplwiu6yduox6m.xml“与{uri:a-zA-Z0-9-/.+}匹配
移动终端文件路由规则中的uri:a-zA-Z0-9-/.+}
示例
$router = new Phalcon\Mvc\Router();
$router->notFound(array(
'controller' => 'index',
'action' => 'error404',
));
$router->add(
'/sitemapsyswrub7g5ox6mtz2tbplwiu6yduox6m.xml', array(
'controller' => 'index',
'action' => 'sitemap'
)
);
$router->add(
'/{uri:[a-zA-Z0-9\-\/\.]+}', array(
'controller' => 'index',
'action' => 'index',
)
);
$router->add(
'/', array(
'controller' => 'index',
'action' => 'index'
)
);
return $router;https://stackoverflow.com/questions/43016915
复制相似问题