加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 使用IIS 7重写模块重写Ampersand URL

发布时间:2020-12-15 22:18:39 所属栏目:asp.Net 来源:网络整理
导读:如何在web.config文件中的url重写规则中使用符号()? 我想重写网址: http://www.foo.com/index.asp?SomeParameter=SomeValueSomeId=00 至: http://www.foo.com/Section/Page 我在web.config中编写了以下规则: rule name="RuleName" stopProcessing="true"
如何在web.config文件中的url重写规则中使用&符号(&)?

我想重写网址:

http://www.foo.com/index.asp?SomeParameter=SomeValue&SomeId=00

至:

http://www.foo.com/Section/Page

我在web.config中编写了以下规则:

<rule name="RuleName" stopProcessing="true">
      <match url="^index.asp?SomeParameter=SomeValue&SomeId=00" ignoreCase="true" />
      <action type="Redirect" url="Section/Page"  appendQueryString="false" />
    </rule>

但是我在输入网址中遇到了&符号(&)的问题.在尝试重写时我得到:

The requested page cannot be accessed because the related
configuration data for the page is invalid.

我试图将&符解析为&,但我得到同样的错误.

解决方法

尝试使用HTML&符号字符代码& amp;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读