1

Yii フレームワークで Web サイトを作成していて、エントリ スクリプトを非表示にしようとしています。ローカル (MAMP) サーバーではすべて正常に動作しますが、Uni の Linux サーバーにデプロイしようとすると問題が発生します。に関連しているとUserDir思いますが、よくわかりません。

リクエストするとhttp://website/username/site/research :

The requested URL /~home/username/public_html/index.php was not found on this server.

.htaccessはこのように見えます:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule ^.*$ index.php

問題の調査を開始する場所がわかりません。と一緒UserDirでしょうか?または私の.htaccessmod_rewrite?またはの構成でYii

4

1 に答える 1

0

まず、これを試してください:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

次に、apache の設定が原因で問題が発生する可能性があります。オプション「AllowOverride」は「すべて」に設定する必要があります。

<VirtualHost *:80>
    ServerAdmin admin@localhost
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /home/sites/example.com/frontend/www

    DirectoryIndex index.php index.html
    <Directory /home/sites/example.com/frontend/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
                allow from all
    </Directory>
</VirtualHost>
于 2013-09-24T11:16:33.670 に答える