用url重写隐藏查询字符串

时间:2016-02-22 16:29:49

标签: asp.net iis url-rewriting query-string

我有一个像www.example.com/items/report.asp?id=2&no=12&iq=200&td=1

这样的查询字符串

如何使用url rewrite隐藏查询字符串部分?

输出应该像:www.example.com/items/report.asp

<rule name="Redirect" stopProcessing="true">
    <match url="(.*)" />
    <conditions trackAllCaptures="true">
        <add input="{QUERY_STRING}" pattern="id=([0-9]+)" />
        <add input="{QUERY_STRING}" pattern="&amp;no=([0-9]+)" />
        <add input="{QUERY_STRING}" pattern="&amp;iq=([0-9]+)" />
        <add input="{QUERY_STRING}" pattern="&amp;td=([0-9]+)" />
        <add input="{REQUEST_URI}" pattern="^/items/report.asp" negate="true" />
    </conditions>
    <action type="Rewrite" url="/items/report.asp" appendQueryString="false" redirectType="Found"/>
</rule>

0 个答案:

没有答案