简体   繁体   English

IIS ARR重写URL路径作为查询字符串参数

[英]IIS ARR Rewrite URL Path as Query String Parameter

I want to convert, 我想转换,

http://domain/something/another?param1=value1 http:// domain / something / another?param1 = value1

to

http://domain/?paramz=something&paramy=another&param1=value1 http:// domain /?paramz = something&paramy = another&param1 = value1

with ARR IIS LB in Azure. 在Azure中使用ARR IISLB。

This rule should work for you: 此规则应为您工作:

<rule name="ARR Rewrite" stopProcessing="true">
   <match url="([^/]+)/?([^/]+)?/?" />
    <conditions>
        <add input="{QUERY_STRING}" pattern="param1=" />
    </conditions>
   <action type="Rewrite" url="/?paramz={R:1}&amp;paramy={R:2}" appendQueryString="true" />                   
 </rule>

It is checking if URL have two segments ( /something/another ) and query string has parameter param1 in query string then it's rewriting as you want 它正在检查URL是否具有两个段( /something/another ),并且查询字符串在查询字符串中具有参数param1 ,然后根据需要进行重写

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

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