Ssl https URL重写到域根,不保留URL结构

Ssl https URL重写到域根,不保留URL结构,ssl,iis-7,url-rewriting,web-config,iis-7.5,Ssl,Iis 7,Url Rewriting,Web Config,Iis 7.5,我正在尝试将http上的任何url改写为https等价物 我的规则重写为https,但它默认返回到域根,并且不保留url结构 即->重写为->,而不是 这似乎很管用 <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions trackAllCaptures

我正在尝试将http上的任何url改写为https等价物

我的规则重写为https,但它默认返回到域根,并且不保留url结构

即->重写为->,而不是


这似乎很管用

<rewrite>
 <rules>


 <rule name="HTTP to HTTPS redirect" stopProcessing="true">
    <match url="(.*)" />
      <conditions trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="off" />
      </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
 </rule> 

 </rules>
</rewrite>
<rewrite>
 <rules>


 <rule name="HTTP to HTTPS redirect" stopProcessing="true">
    <match url="(.*)" />
      <conditions trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="off" />
      </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
 </rule> 

 </rules>
</rewrite>