我在 web.config 中有以下重写规则
<rewrite url="~/product/(.+)" to="~/outbound-link-proxy.aspx?product=$1" />
这应该重写(例如)
mydomain.com/product/car
至
mydomain.com/outbound-link-proxy.aspx?product=car
这工作正常。但是我注意到有些网站链接到我的网站,并在最后添加了自己的查询字符串。我不介意这一点,但它打破了我的重写。
mydomain.com/product/car?foreignQueryString=983249
如何创建重写规则以保留我的原始重写但忽略任何查询字符串,以便
mydomain.com/product/car?foreignQueryString=983249
仍然重写为
mydomain.com/outbound-link-proxy.aspx?product=car