I am trying to remove the last part of the URL with IIS Rewrite, but somewhere I do the things wrong. Example URL: https://example.com/BGLog/pages/register/?ReturnUrl=/blog/arebemagare/site/posts/?bid=37780&PageSpeed=noscript I need to remove &PageSpeed=noscript I wroted rule, but it strips also ?ReturnUrl=/blog/arebemagare/site/posts/?bid=3778 :
<rule name="Remove paging parameters" stopProcessing="true">
<match url="(.*)?$" />
<conditions trackAllCaptures="true">
<add input="{QUERY_STRING}" pattern="(.*)(.*)&PageSpeed=noscript(.*)" />
</conditions>
<action type="Redirect" url="{R:1}" appendQueryString="false" redirectType="Temporary" />
Any suggestion? Thanks!
3条答案
按热度按时间emeijp431#
我想我做到了,但有两条规则:
vxbzzdmp2#
请尝试以下规则:
我的测试结果是有效的,希望这对你也有效。
xwmevbvl3#
它工作了!但是我发现它也捕获了https://example.com/BGLog/blog/filteredlist?cat=5021&PageSpeed=noscript并将其重写为https://example.com/BGLog/blog/filteredlist
我试着编辑它,使其不剥离?cat=5021,但没有成功:(