查询字符串多次出现 [英] query string get appened more than once

查看:127
本文介绍了查询字符串多次出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用url重写模块(来自此处)。我在web.config中定义了以下规则,以将任何http流量定向到https。

I am using url rewrite module (from here). I have following rule defined in my web.config to direct any http traffic to https.

<rewrite>
      <rules>
        <rule name="https redirect" enabled="true" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="SeeOther" />
        </rule>
      </rules>
</rewrite>

我有一个问题。我的网址还可能包含查询字符串中的一些加密和编码数据。看起来这个规则是通过多次追加查询参数来更改参数,如下所示。

I have one question. My url may also contains some encrypted and encoded data in query string. Seem like this rule is changing the parameters by appendding the query parameter more than once as shown below.

实际网址

http://www.MySite.com?Data=nBdHuQ6Jt2nHCnh5FG

申请规则后

https://www.MySite.com?数据= nBdHuQ6Jt2nHCnh5FG?数据= nBdHuQ6Jt2nHCnh5FG

任何想法我在这条规则中做错了什么?

Any ideas what I am doing wrong in this rule?

推荐答案

您需要为 {HTTP_HOST} {URL} {HTTP_HOST} {REQUEST_URI} code>

You need to change {HTTP_HOST}{REQUEST_URI} for {HTTP_HOST}{URL}

这篇关于查询字符串多次出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆