简体   繁体   中英

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.

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

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. 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.

Rewritten Url

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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