效果:
http://yrwr.net/thread-15.htm
http://www.yrwr.net/thread-15.htm
https://www.yrwr.net/thread-15.htm
全部跳转到https://yrwr.net/thread-15.htm

前提:
http://yrwr.net
http://www.yrwr.net
https://yrwr.net
https://www.yrwr.net
域名全部绑定服务器

修改web.config文件添加

<rewrite>
<rules>
    <rule name="HostNameRule1">
                   <match url="(.*)" />
                   <conditions logicalGrouping="MatchAny">
                       <add input="{HTTPS}" pattern="^OFF$" />
                       <add input="{HTTP_HOST}" pattern="^yrwr\.net$" negate="true" />
                   </conditions>
                   <action type="Redirect" url="https://yrwr.net/{R:1}" />
               </rule>
               <rule name="HTTPS redirect">
                   <match url="(.*)" />
                   <conditions>
                       <add input="{HTTPS}" pattern="^ON$" />
                       <add input="{HTTP_HOST}" pattern="^yrwr\.net$" negate="true" />
                   </conditions>
                   <action type="Redirect" url="https://yrwr.net/{R:1}" redirectType="SeeOther" />
               </rule>
    <rule name="xiuno3">
    <match url="^((.*)/)?(.+).htm$" />
    <action type="Rewrite" url="{R:1}\index.php?{R:2}.htm" />
    </rule>
</rules>
</rewrite>


最后修改:2019 年 06 月 06 日
如果觉得我的文章对你有用,请随意赞赏