12

私はURLリライトで本当に新しく、複数のクエリをリライト/リダイレクトしようとしていますが、機能していないようです。これは検索結果であり、さまざまなフィルタリングが付属しているため、クエリは異なる場合があります。たとえば、クエリがある検索t1=somethingと、次のt2=somethingelseように組み合わせる検索があります。t1=something&t2=somethingelse

web.configでIIS7を使用しています。これまでに行ったことは次のとおりです。
これは私のリンクの例です

www.website.com/search/?t1=first&t2=second 

私は次のことを試しましたが、実際には機能しませんでした:
(1)

<rewrite> 
    <rules> 
        <rule name="first" stopProcessing="true">
            <match url="search/" />
            <conditions trackAllCaptures="true">
                <add input="{QUERY_STRING}" pattern="t1=([0-9a-zA-Z]+)" />
            </conditions>
            <action type="Redirect" url="search/{C:1}/" appendQueryString="false" />
        </rule>

        <rule name="second" stopProcessing="true">
            <match url="search/" />
            <conditions trackAllCaptures="true">
                <add input="{QUERY_STRING}" pattern="t2=([0-9a-zA-Z]+)" />
            </conditions>
            <action type="Redirect" url="search/{C:1}/" appendQueryString="false" />
        </rule>
    </rules>
</rewrite>

(2)

<rule name="a" stopProcessing="true">
    <match url="search2/" />
    <conditions trackAllCaptures="true">
        <add input="{QUERY_STRING}" pattern="t1=([0-9a-zA-Z]+)" />
        <add input="{QUERY_STRING}" pattern="t2=([0-9a-zA-Z]+)" />
    </conditions>
    <action type="Redirect" url="search2/{C:1}/{C:2}" appendQueryString="false" />
</rule>

助けていただければ幸いです。

ありがとう。

4

2 に答える 2