当前位置: 代码迷 >> PHP >> cakephp默认url指向有关问题
  详细解决方案

cakephp默认url指向有关问题

热度:563   发布时间:2012-02-04 15:43:09.0
cakephp默认url指向问题

阅读时注意index有s和没s

cakephp默认访问localhost时不是指向localhost/index吗
现在我没建index、所以这个路径显示Not Found

Error: The requested address '/' was not found on this server.
我建个indexs_controller.php
但是cakephp默认controller是复数的、、
所以只有访问localhost/indexs时页面才是正确的、、
但是默认cakephp路由指向的是localhost/index
如何更改默认指向到localhost/indexs


------解决方案--------------------
你在config/routes.php文件设置一下,文件跳转路由,Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));设置里面的controller与action应该就可以了!