简体   繁体   English

iis不能使用符号和正则表达式模式

[英]iis can't use symbol & in regex pattern

i try to write rule, thats skip symbol & in querystring. 我试着写规则,那就是跳过符号和查询字符串。 For, that i wrote the following rule: 因为,我写了以下规则:

<rule name="skip-firt parametr" stopProcessing="true">
  <match url="^page1/"/>
  <conditions>
     <add input="{QUERY_STRING}" pattern="id=([0-9]+)\&?(.*)"/>
  </conditions>
  <action type="Redirect" url="page2/{C:1}/?{C:2}" appendQueryString="true"/>
</rule>

But i have following error, when i try open resource 但是当我尝试打开资源时,我有以下错误

Config Error    Configuration file is not well-formed XML

When I remove '&' from pattern rule works. 当我从模式规则中删除'&'时。

You can fix that by replacing & with &amp; 您可以通过替换&&amp;来解决这个问题&amp; .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM