我正在使用cake1.3.5
我最近将一个实时工作站点移到了我的localhost:
我将config.php设置为我的本地数据库但是当我进入该网站时,我看到了:
是否还有其他缺少的步骤(关于文件路径或其他内容)?
答案 0 :(得分:5)
Cake将所有调用指向webroot文件夹(默认情况下称为URL重写)。这是通过文档根目录中的.htaccess文件实现的,该文件必须具有(用于URL重写才能工作)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
webroot文件夹中的.htaccess文件应包含
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d // this line traps requests for directory
RewriteCond %{REQUEST_FILENAME} !-f // this line traps requests for file names
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
两行RewriteCond %{REQUEST_FILENAME} !-d
&amp; RewriteCond %{REQUEST_FILENAME} !-f
在解析目录和文件名请求时至关重要。
第RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
行处理的不是文件或目录。
您可能需要查看URL rewriting
答案 1 :(得分:0)
经历了相同的情况后,事实证明localhost无法识别短样式标记仅在服务器上的php.ini配置文件中启用时才可用。
当我更改标签时,所有页面都正常显示。