0

次の書き換えルールを設定しました

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ core/index.php [L]

サイトのアーキテクチャは

newsite
 ﹂ .htaccess
 ﹂ core
     ﹂ index.php

WindowsでURL:http:// localhost / web / newsite / testを使用すると、/ web / newsite
/ core / index.php にリダイレクトされ、機能 します。ただし、 Ubuntuで URL http:// localhost /〜user1 / web / newsite / testを使用すると、/~user1/web/newsite/では なく/home/user1/public_html/web/newsite/core/index.php にリダイレクトされます。 core / index.php では、どうすればこの問題を解決できますか? ありがとう!







4

1 に答える 1

0

ルールの上に a を追加しRewriteBaseます。

RewriteBase /~user1/web/newsite/

ubuntu 上の Apache は、書き換えルールのターゲットが URI パスまたはファイル パスであるかどうかを推測しようとしますが、推測が間違っているため、実際の相対 URI ベースが何であるかを伝える必要があります。

于 2012-09-30T19:29:40.723 に答える