簡體   English   中英

IIS Url重寫入站規則進程查詢字符串

[英]IIS Url Rewrite inbound rules process query string

我在不知道如何將查詢字符串傳遞到自定義網址重寫模塊時遇到了麻煩。 我已經開發了一個自定義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

網址已更改

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進行處理。

重寫網址

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM