Cakephp安装htaccess问题


cakephp installation htaccess issue

我试图在www.domain.com/demo/realestate中安装CakePHP,我在root, app,webroot中更改了.htaccess,参考了cakebook, S.O.和其他网站。它们大多产生500错误或显示空白页或404错误。

我在每个文件中的.htaccess代码是:


<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /demo/realestate
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>


—in app—

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>


-in webroot-

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

我还试图删除所有.htaccess并根据文档中的建议在app/config/core.php中编写Configure::write('App.baseUrl', env('SCRIPT_NAME'));,但随后它开始将demo作为控制器名称和realestate作为函数名称。

我请求你指导我设置它!

如果您想在www.domain.com/demo/realestate中安装cakephp,则不需要更改htaccess。只需复制所有cakephp文件和文件夹在房地产文件夹与默认htaccess,它会工作。