【发布时间】:2013-09-13 11:55:16
【问题描述】:
我的 cake 2.2.0 应用程序中的重写规则有问题。
Mod_rewrite 似乎在这里工作:
myapp.com/listings 有效
但是 cake 生成的链接构造了这种类型的 URL,它也可以工作,但不会被重写:
myapp.com/app/webroot/index.php/listings
我尝试了很多已发布的选项,但似乎没有任何效果?
我的 apache 配置设置如下:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
所有 .htaccess 文件都是 cake install 的标准文件?
Webroot .htacess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
应用程序.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
根.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
我应该看看别的吗?
【问题讨论】: