2016-12-26 133 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}} 
相關問題