私はApacheで以下を実行します。私たちのIT担当者は、Webトラフィックを最適化するためにApacheよりNginxを推奨しました。しかしmodrewriteはNginxでも同じように動作しません。NginxのPATH変数を使ってすべてのディレクトリをルートにリダイレクトする方法はありますか(Apacheから切り替える)?
基本的に私はパス変数にTLDの後にすべての情報を変換するに興味がある: だから、domain.com/abc/def/リダイレクト
することができますをdomain.com/index.php/abc/def/しますNginxでそれを手伝ってもらえますか?以下はApacheでこれを可能にします。
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
RewriteEngine On
# The following redirects all directories to root using PATH variables
# Ex. /abc/def/ redirects to /index.php/abc/def/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [L]
</IfModule>
ありがとう。