此规则不会将查询字符串添加到输出中,我无法解释原因: -
<rule name="Show Week" stopProcessing="true">
<match url="^show-week.aspx(.*)" />
<action type="Redirect" url="showresort.aspx{R:1}" redirectType="Permanent" appendQueryString="true" />
</rule>
输入网址为www.mysite.com/show-week.aspx?siteId=EUR&resortId=672&resortType=1&avail=0
outupt URL应该是www.mysite.com/showresort.aspx?siteId=EUR&resortId=672&resortType=1&avail=0
但我得到的只是www.mysite.com/showresort.aspx
答案 0 :(得分:1)
您可以使用trackAllCaptures捕获查询字符串,然后将其附加到新网址。
<rule name="Show Week" stopProcessing="true">
<match url="^show-week.aspx(.*)" />
<conditions trackAllCaptures="true">
<add input="{QUERY_STRING}" pattern="(.*)" />
</conditions>
<action type="Redirect" url="showresort.aspx?{C:1}" redirectType="Permanent" appendQueryString="false"/>
</rule>