简体   繁体   English

IIS Url重写入站规则进程查询字符串

[英]IIS Url Rewrite inbound rules process query string

I am having trouble in not knowing how to pass the query string to a custom url rewrite module. 我在不知道如何将查询字符串传递到自定义网址重写模块时遇到了麻烦。 I have developed a custom url rewrite module that would recieve the complete url ( path + query string) and rewrite some query string values. 我已经开发了一个自定义url重写模块,该模块将接收完整的url(路径+查询字符串)并重写一些查询字符串值。

How do i pass the query string to custom module when using it in inbound rules ? 在入站规则中使用查询字符串时,如何将其传递给自定义模块?

Rule Evaluation Start 规则评估开始

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 match 模式匹配

Pattern
BOE/(.*) 

Input
BOE/OpenDocument/opendoc/openDocument.jsp 

Negate
false 

Matched
true 

Because if you see above/below, my custom module does not receive the query string but only the path APP.Web/BOE/OpenDocument/opendoc/openDocument.jsp 因为如果您在上方/下方看到,我的自定义模块不会收到查询字符串,而只会收到路径APP.Web/BOE/OpenDocument/opendoc/openDocument.jsp

Url Changed 网址已更改

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

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

Okay i found the answer out myself. 好吧,我自己找到了答案。 You can reference the custom url rewrite module in your inbound or outbound rule Action section. 您可以在入站或出站规则“操作”部分中引用自定义url重写模块。 I had to just include the query string also as input to my custom module like below. 我只需要将查询字符串也包括在内,作为我自定义模块的输入,如下所示。 Where TOKEN is the custom module i had to add to IIS for processing per my requirement. TOKEN是自定义模块,我必须根据自己的要求将其添加到IIS进行处理。

Rewritten Url 重写网址

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

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

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