0

それは私のプロジェクトディレクトリです:

/webroot
/myproject
    index.php
    /application
    /config
    /library
    /public
        /css
        /img
        /js
        index.php
        .htaccess

それは /myproject/index.php の私のコードです

<?php include 'public/index.php';

.htaccess ファイルのコード:

#SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteRule !\.(js|ico|gif|jpg|png|css|swf|html|pps)$ index.php [NC,L]

order allow,deny
allow from all

問題は、css、img、js ディレクトリから css、img、または js ファイルを読み込めないことです。

The requested URL /css/style.css was not found on this server.
4

1 に答える 1

0

これは htaccess の問題ではありません。DOCUMENT_ROOT はパブリック フォルダーを指す必要がありますが、現在は myproject フォルダーを指しているように見えます (これは大きなセキュリティ ホールです)。/myproject/css/style.cssおそらく、それがうまく機能することがわかります。これを修正するには、仮想ホストの設定を更新する必要があります。

于 2013-02-01T16:28:12.020 に答える