Home  >  Article  >  Backend Development  >  cakephp默认url指向有关问题

cakephp默认url指向有关问题

WBOY
WBOYOriginal
2016-06-13 13:53:30973browse

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应该就可以了!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn