私は Isapi Rewrite 3 (IIS の mod 書き換えクローン) を使用しており、クエリ文字列に基づいて URL を書き換えようとしています。次に、書き換えでそのクエリ文字列の一部を渡します。
したがって、次のような URL を入力すると: /test/home.cfm?page=default&arbitraryExtraArg=123
/test/index.cfm?page=home&arbitraryExtraArg=123のように書き換えてください。
次の条件/ルールがあります。
RewriteCond %{QUERY_STRING} ^page=default(.*)$ [I]
RewriteRule ^/test/home.cfm$ /test/index.cfm?page=home%1 [I,R=301]
ただし、余分なクエリ文字列変数が渡されることはありません。%1 が空白のようです。
これがRewriteCondからパターンマッチを参照する方法ですよね?
ここで何が欠けていますか?
ありがとう!
編集: RewriteCond が完全に無視されているように見えます。私のログファイルは次のようになります。
[snip] (2) init rewrite engine with requested uri /test/home.cfm?page=default
[snip] (1) Htaccess process request C:\Inetpub\wwwroot\dev\IsapiRewrite\httpd.conf
[snip] (3) applying pattern '^/test/home\.cfm$' to uri '/test/home.cfm'
[snip] (1) escaping /test/index.cfm?page=home
[snip] (2) explicitly forcing redirect with http://www.devsite.com/test/index.cfm?page=home
[snip] (2) internal redirect with /test/home.cfm?page=default [INTERNAL REDIRECT]
[snip] (2) init rewrite engine with requested uri /test/index.cfm?page=home
[snip] (1) Htaccess process request C:\Inetpub\wwwroot\dev\IsapiRewrite\httpd.conf
[snip] (3) applying pattern '^/test/home\.cfm$' to uri '/test/index.cfm'
そこに RewriteCond パターン チェックについて言及する必要がありますか?