0

私は Windows で作業しており、mod_rewrite エンジンがオフになっています。だから私のcakephpプロジェクトはそれでうまくいきますが、今はUBuntuに移行し、mod_rewriteエンジンがオンになっています。私のプロジェクトは、css イメージとその他のリソースのエラーが見つかりませんで終了します。私の mod_rewrite エンジンがオンで、プロジェクトを正しく実行したい場合、どのような変更を行う必要がありますか? Cakephp の 2.3 バージョンを使用しています。

プロジェクト/アプリ/index.php

require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';

プロジェクト/アプリ/.htaccess

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

project/app/webroot/.htaccess

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

エラーは

"NetworkError: 404 Not Found - http://localhost/project/css/citynightlife/bootstrap.min.css"
"NetworkError: 404 Not Found - http://localhost/project/css/citynightlife/menu/styles/lwhite.css"

このネットワーク エラーは、すべての css、js、およびイメージで発生します。

4

1 に答える 1

2

etc/apache2/sites-available フォルダー内の仮想ホスト ファイルを確認してみてください。タグで以下を All に設定する必要があります。

AllowOverride All
于 2013-08-27T06:20:41.460 に答える