Iirfv2.0を使用しています。
私は次のディレクトリ構造を持っています:
/
/library
/library/index.php
/webroot
/webroot/images
/Iirf.ini
アプリケーションを含むライブラリフォルダー、webrootフォルダー(画像、スタイルシートなどを含む)、およびIirf.ini構成ファイルがある場合。
ファイルがwebrootの下に存在しない場合、すべてのリクエストを/library/index.phpにリダイレクトしたいと思います。
例えば:
Request Response
/images/blah.png -> /webroot/images/blah.png
/news -> /library/index.php
私のIirf.ini構成には次のものがあります。
RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /library/index.php [L]
これはすべてをリダイレクトしますが、webrootの下/library/index.php
に存在するかどうかを確認する方法を見つけるのに問題があります。REQUEST_FILENAME
この質問を見ましたが、にアクセスできませんDOCUMENT_ROOT
。それは私に次のことを与えます(ログから取得):
Thu Jul 15 11:46:21 - 760 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='C:\web\favicon.ico'
Thu Jul 15 11:46:21 - 760 - ReplaceServerVariables: in='%{DOCUMENT_ROOT}/webroot/%{REQUEST_FILENAME}' out='DOCUMENT_ROOT/webroot/C:\web\favicon.ico'
どんな助けでも大歓迎です。
---編集-
ティムのより多くの読書と提案の後に私の設定を更新しました:
RewriteCond $0 !^/webroot
RewriteRule ^.*$ /webroot$0 [I]
RewriteCond $0 !-f
RewriteRule ^/webroot/(.*)$ /library/index.php [I,L,QSA]
そして、それは正しく渡され/library/index.php
ますが、それでも既存のファイルをチェックしません(そうしているように見えますが)。
Thu Jul 15 14:47:30 - 3444 - EvalCondition: checking '/webroot/images/buttons/submit.gif' against pattern '!-f'
Thu Jul 15 14:47:30 - 3444 - EvalCondition: cond->SpecialConditionType= 'f'
Thu Jul 15 14:47:30 - 3444 - EvalCondition: Special: it is not a file
フィルタの作成者に連絡する必要があると思います。