Isapi Rewrite 3(IIS用のmodリライト・クローン)を使用していて、クエリ文字列に基づいてURLを書き直そうとしていて、そのクエリ文字列の一部を書き換え。Isapi Rewrite - RewriteRuleでクエリ文字列パターンに一致する
私はこのようなURLを入力してあれば:/test/index.cfm?page:/test/home.cfm?page=default & arbitraryExtraArg = 123
私はのように書き換えることにしたいです
RewriteCond %{QUERY_STRING} ^page=default(.*)$ [I]
RewriteRule ^/test/home.cfm$ /test/index.cfm?page=home%1 [I,R=301]
しかし、余分なクエリ文字列variabl:=自宅& arbitraryExtraArg = 123
私は、次の条件/ルールを持っていますesは決して通過しません。 %1は空白のようです。
これは、RewriteCondからパターンマッチを参照する方法です。
私はここで何が欠けていますか?
ありがとうございます!
EDIT: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'
:ここに私のログファイルがどのように見えるのですか?
しかし、ルールは適用されますか? – Gumbo
うん、まさに。私は/test/index.cfm?page=homeに行きます。 – stubotnik
そして、 '/test/home.cfm?page = default'の最初のリクエストはどうですか?あるいは、 '/test/index.cfm?page = home'だけで長時間テストしていますか?もしそうなら、おそらく、あなたはURL書き換えがどのように機能するか誤解していました。彼らは要求されたURIを書き換えるだけです! – Gumbo