C# IIS Url重写入站规则处理查询字符串

C# IIS Url重写入站规则处理查询字符串,c#,iis,url-rewriting,C#,Iis,Url Rewriting,我不知道如何将查询字符串传递到自定义url重写模块时遇到了问题。我开发了一个自定义url重写模块,它将接收完整的url(路径+查询字符串),并重写一些查询字符串值 在入站规则中使用查询字符串时,如何将其传递给自定义模块 规则评估开始 RuleName ReverseProxyInboundRule1 RequestURL OpenDocument/opendoc/openDocument.jsp QueryString sIDType=CUID&iDocID=AbuyCUsQ8L

我不知道如何将查询字符串传递到自定义url重写模块时遇到了问题。我开发了一个自定义url重写模块,它将接收完整的url(路径+查询字符串),并重写一些查询字符串值

在入站规则中使用查询字符串时,如何将其传递给自定义模块

规则评估开始

RuleName
ReverseProxyInboundRule1 

RequestURL
OpenDocument/opendoc/openDocument.jsp 

QueryString
sIDType=CUID&iDocID=AbuyCUsQ8L5CskKTqgOSsyw&encoded=9001306c-317f-4332-b03f-44cca57918c2 

PatternSyntax
0 

StopProcessing
true 

RelativePath
/APP.Web/ 

PatternSyntax
Regex 
模式匹配

Pattern
BOE/(.*) 

Input
BOE/OpenDocument/opendoc/openDocument.jsp 

Negate
false 

Matched
true 
因为如果您在上面/下面看到,我的自定义模块不会接收查询字符串,而只接收路径
APP.Web/BOE/OpenDocument/opendoc/OpenDocument.jsp

Url已更改

OldUrl
/APP.Web/BOE/OpenDocument/opendoc/openDocument.jsp?encoded=9001306c-317f-4332-b03f-44cca57918c2 

NewUrl
https://server/BOE/OpenDocument/opendoc/openDocument.jsp

好吧,我自己找到了答案。您可以在入站或出站规则操作部分中引用自定义url重写模块。我必须将查询字符串也作为输入包含到自定义模块中,如下所示。其中,TOKEN是我必须添加到IIS的自定义模块,以便按照我的要求进行处理

重写的Url

http://SERVER/BOE/{TOKEN:{R:1}?{QUERY_STRING}}