将以下代码保存为uft8格式的web.config 文件放到IIS空间下的程序根目录。注意修改成你自己的域名。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="www.fangyuwang.com" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^www.fangyuwang.com" />
<add input="{SERVER_PORT}" pattern="80" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://www.fangyuwang.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>