【问题标题】:IIS Url Rewrite inbound rules process query stringIIS Url Rewrite 入站规则处理查询字符串
【发布时间】:2017-05-10 19:59:07
【问题描述】:

我不知道如何将查询字符串传递给自定义 url 重写模块。我开发了一个自定义 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

【问题讨论】:

    标签: c# iis url-rewriting


    【解决方案1】:

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

    重写的网址

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

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-24
      • 2016-09-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多