在 cakephp 中找不到
NotFound in cakephp
我是 CakePHP 的新手,在这个项目中,有一个像
这样的路由
Router::connect('/', array('controller' => 'pages', 'action' => 'index'));
如果我访问http://localhost/
,它会显示view
的内容
但如果我将其更改为
Router::connect('/asdf', array('controller' => 'pages', 'action' => 'index'));
访问http://localhost/asdf
,会提示404 not found。
我搜索了很多,不知道为什么
示例代码在这里:
将此代码添加到 routes.php 文件的末尾。
require CAKE . 'Config' . DS . 'routes.php';
我是 CakePHP 的新手,在这个项目中,有一个像
这样的路由Router::connect('/', array('controller' => 'pages', 'action' => 'index'));
如果我访问http://localhost/
,它会显示view
但如果我将其更改为
Router::connect('/asdf', array('controller' => 'pages', 'action' => 'index'));
访问http://localhost/asdf
,会提示404 not found。
我搜索了很多,不知道为什么
示例代码在这里:
将此代码添加到 routes.php 文件的末尾。
require CAKE . 'Config' . DS . 'routes.php';