過去 3 日間、私は Apache の mod_rewrite をいじって、URL から index.php を削除しようとしましたが、php はまだパスでそれを確認する必要があります。
Essentially PHP needs to see this
http://example.com/index.php/Page/Param1/Param2
While the user needs to see this
http://example.com/Page/Param1/Param2
私が今持っているのは、htaccessファイルの次のとおりです
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC]
RewriteRule ^ /%1 [R=301,L]
これは別のページから取得したもので、必要なものに近いものです。http://example.com/
しかし、これはパートの後のすべてを切り取っているようです。mod_rewrite でユーザーに 1 つのものを表示し、php に別のものを表示するにはどうすればよいですか?