【问题标题】:IIS Redirect with More than 1 Parameter具有多个参数的 IIS 重定向
【发布时间】:2014-01-25 18:28:25
【问题描述】:

当我尝试重定向到查询字符串中包含超过 1 个参数的另一个页面时,我收到错误消息。

这行得通:

<rule name="t6" stopProcessing="true">
    <match url="^test.html$" />
    <action type="Redirect" url="mypage.aspx?param=1" redirectType="Permanent" />
</rule>

这不起作用:

<rule name="t6" stopProcessing="true">
    <match url="^test.html$" />
    <action type="Redirect" url="mypage.aspx?param=1&param2=2" redirectType="Permanent" />
</rule>

你能弄清楚发生了什么吗?

谢谢,

阿曼多

【问题讨论】:

    标签: asp.net iis http-redirect


    【解决方案1】:

    替换实例

    &
    

    &amp;
    

    所以你的 url 参数变成了

    url="mypage.aspx?param=1&amp;param2=2"
    

    这是xml的编码要求。

    参考:Which characters are Invalid (unless encoded) in an XML attribute?

    【讨论】:

      猜你喜欢
      • 2017-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-21
      • 2011-03-26
      • 2012-03-31
      • 2021-03-25
      • 1970-01-01
      相关资源
      最近更新 更多