下面代码以本站网址zhangshao.shop为示例,请根据需要自行修改。修改后复制跳转代码,粘贴到站点根目录下web.config或新建web.config文件中。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="301" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" ></match>
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" ></add>
</conditions>
<action type="Redirect" url="https://zhangshaobiji.cn/{R:1}" redirectType="Permanent" ></action>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
是不是很简单