http://example.com/whatever/index.phpへの 301 リダイレクトを行うために、 のようなリクエストが必要ですhttp://example.com/whatever/。
追加してみました:
rewrite ^(.*/)index.php$ $1 permanent;
location / {
index index.php;
}
ここでの問題は、この書き換えがルート URL で実行されるため、無限のリダイレクト ループが発生することです。
編集:
一般的な解決策が必要です
http://example.com/ファイルを提供する必要がありますwebroot/index.php
http://example.com/index.php、301リダイレクトする必要がありますhttp://example.com/
http://example.com/a/index.phpに 301 リダイレクトする必要がありますhttp://example.com/a/
http://example.com/a/で index.php スクリプトを提供する必要がありますwebroot/a/index.php
基本的に、アドレスバーに「index.php」を表示したくありません。正規の URL にリダイレクトする必要がある古いバックリンクがあります。