效果:
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>
3 条评论
自从用上vps,一切都变得简单了。
习惯了linux,要我来配置windows上的,感陌生的很啊!
win比较反人类