我刚刚完成了入门教程 ( http://book.cakephp.org/2.0/en/getting-started.html ) 并将我的文件放在 Apache 服务器上,该服务器将 Drupal projet 作为根 URL。
Cakephp 的索引页面加载正常,但是当我单击任何项目时,将我的根 url 更改为类似root/posts/view/2
的,它显示 Drupal 的页面未找到错误。
我想这可能是一个重写问题。我的 CakePHP 目录有一个 .htaccess 文件,其中包含:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
我的启用 apache2 站点的 conf 以:
Alias /test /var/www/cakephp/app/webroot
<Directory /var/www/cakephp/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
当我从以下位置更改索引操作路线时:
Router::connect('/', array('controller' => 'posts', 'action' => 'index'));
至 :
Router::connect('/foo', array('controller' => 'posts', 'action' => 'index'));
我遇到了与上述相同的错误。
有什么线索吗?