mod_rewrite の非常に単純なルールを実行していますが、ループが発生します。ルールは次のとおりです。
最初に次のようなリクエストがあれば
index.php/SOMETHING.(txt,jpg,php)
最初に存在するかどうかを確認/SOMETHING.(txt,jpg,png)
して表示する必要があります
ファイルがindex.php/SOMETING
存在する実際のパスではなく、それを表示する場合
そうでない場合...に渡し、index.php/SOMETHING.(txt,jpg,php)
index.phpを表示します
それはすべて機能しますが、存在しないtxt、jpg、phpがある場合は最後のルールです
例 :http://domain.com/index.php/robots1.txt
ファイルが存在しません:/Applications/XAMPP/xamppfiles/htdocs/testredir/robots1.txt
他の拡張機能でも機能します...
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^index.php/.+$
RewriteRule ^index.php/(.+)\.jpg$ $1.jpg [NC,L]
RewriteRule ^index.php/(.+)\.txt$ $1.txt [NC,L]
RewriteRule ^index.php/(.+)\.php$ $1.php [NC,L]
#here I am missing a rule but if i put the following it will loop
#RewriteCond %{REQUEST_URI} -f
#RewriteRule .* index.php/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^index.php/.+$
RewriteRule .* index.php/$0 [PT]