开发者

Rewriting Ampersand URLs with IIS 7 Rewriting Module

How can I use an ampersand (&) in my url rewrite rules in the web.config file?

I want to rewrite the url:

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

to:

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

I wrote the following rule in my 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>
开发者_如何学JAVA

But I'm having problems with that Ampersand (&) in the input url. When trying to rewrite I Get:

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

I Tried to parse the ampersand to %26, but I get the same errror.


Try using the HTML ampersand character code &amp;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜