CakePHP without mod_rewrite causes 404 errors

时光总嘲笑我的痴心妄想 提交于 2019-12-11 01:33:31

问题


I'm pretty new to Cake, so I tryed to start with the blog tutorial.

I installed CakePHP 2.3.8 in webroot. Configured SQL and deleted all 3 .htaccess-files, cause i have no mod_rewrite. In core.php I activated Configure::write('App.baseUrl', env('SCRIPT_NAME')); I created the Posts-Model, Controller and the index-View like the tutorial says.

The APP/View/Pages/home.ctp tells me, everything's allright.

But when i try to open /posts/index i get a 404. Why?


回答1:


Without mod_rewrite the urls look like www.example.com/index.php/controllername/actionname/param, i.e. in your example you have to call /index.php/posts/index (or /index.php/posts/).



来源:https://stackoverflow.com/questions/18054655/cakephp-without-mod-rewrite-causes-404-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!