2016-12-26 160 views
0

我在遇到问题时不知道如何将查询字符串传递给自定义url重写模块。我开发了一个自定义url重写模块,它将接收完整的url(路径+查询字符串)并重写某些查询字符串值。IIS 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 C挂起

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

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

回答

0

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

重写后的URL

http://SERVER/BOE/{TOKEN:{R:1}?{QUERY_STRING}} 
相关问题