我做了所有的设置,不使用mod_rewrite Apache 2.2和CakePHP。Cakephp 2.2没有mod_rewrite重定向错误
Apache2正在运行,Cake似乎也在运行。如果我去http://127.0.0.1/cake/index.php
,所有绿色标签(使用PostgreSQL 9.1)。我按照教程create the blog project创建了控制器文件/var/www/cake/app/Controller/PostsController.php
(也有CakeController
和AppController
和PagesController
文件)。
在模型目录中,我得到了Post.php和AppModel,如教程所述。在View文件夹中,我创建了Posts文件夹和文件index.ctp和view.ctp。
当我输入像http://127.0.0.1/cake/index.php?url=/posts/
这样的网址时,它会转到Cake主文件夹的index.php。它重定向到那里!如果我将URL更改为例如http://127.0.0.1/cake/index.php?url=/posts/view/1
(如教程)一样的东西。这张照片出了什么问题?
我的环境是Debian 6.0-6 64bits。 Apache2.2(与SO一起安装),CakePHP 2.2.3和PHP 5.2.8(或更高版本)。
Dude,ty年老的VM回答,但我想你错过了......正如我说的我的目标是不使用mod_rewrite。因此,如解释我取消注释一行和删除所有.htaccesss(实际上我重命名所有,但),我用网址的提到b4。 –
无论如何,我指出了答案...... Yr链接让我学到了更多。 –