次の条件で適切な .htaccess 書き換えを実行しようとすると問題が発生する
元の URL: http://example.com/foo/bar/ANYTHING (http または https のいずれか、ANYTHING はユーザーが入力したものであれば何でもかまいません)
書き換えられた URL: https://example.com/foo/bar/index.php/this/that/ANYTHING
ただし、すでに index.php が含まれているものは何も書き直さないでください。
いくつかのオプションを試しましたが、新しい URL にファイル システム パスが含まれています。
私の試み:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /foo/bar/
RewriteCond %{HTTP_HOST} example.com$ [NC]
RewriteCond %{HTTP_HOST} !index.php
RewriteRule ^(.*)$ https://example.com/foo/bar/index.php/this/that/$1 [R=301,L]