URL重写未保留完整路径
我正在尝试使用IIS 8的URL重写模块来确保所有连接都是https。我不知道如何维护规则的完整路径。我是新手,希望这是一个简单的解决方案 我将转到这样的页面: 从“https”中删除“s”后,我被重定向到,并且URL重写未保留完整路径,url,url-rewrite-module,Url,Url Rewrite Module,我正在尝试使用IIS 8的URL重写模块来确保所有连接都是https。我不知道如何维护规则的完整路径。我是新手,希望这是一个简单的解决方案 我将转到这样的页面: 从“https”中删除“s”后,我被重定向到,并且mypath路径不见了。我需要维护这个 以下是webconfig条目: <rewrite> <rules> <rule name="Force http to https" stopProcessing="true">
mypath
路径不见了。我需要维护这个
以下是webconfig条目:
<rewrite>
<rules>
<rule name="Force http to https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
试试这个:
<!-- Require HTTPS -->
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
试试这个:
<!-- Require HTTPS -->
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
我在网上看了一个例子后遇到了同样的问题。我将重定向url更改为
https://{HTTP\u HOST}/{REQUEST\u URI}
,并在重定向请求中保留完整的url
有关参考信息,请参阅联机文档。我在联机学习了一个示例后遇到了相同的问题。我将重定向url更改为
https://{HTTP\u HOST}/{REQUEST\u URI}
,并在重定向请求中保留完整的url
参考请参见在线文档