我尝试将我的网站重定向到https://www,但无法正常工作
http://example.com-〉正在重定向到https://www.example.com
https://example.com-〉正在重定向到https://www.example.com
http://www.example.com-〉未重定向,应重定向到https://www.example.com
这里我有重定向:
<rules>
<rule name="Remove trailing slash" stopProcessing="true">
<match url="(.*)/$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
<rule name="HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
</rule>
<rule name="Redirect to www" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^m4music.ch$" />
</conditions>
<action type="Redirect" url="https://www.m4music.ch/{R:1}" />
</rule>
</rules>
有人知道吗?
1条答案
按热度按时间xzlaal3s1#
请尝试以下重写规则代码: