301重定向

http://www.microsoft.com/zh-CN/download/details.aspx?id=7435

http://www.jquery001.com/asp.net-mvc3-redirectpermanent.html

http://www.lidongkui.com/301-permanent-redirecting-non-www-domain-to-www-domain-in-asp-net-mvc-3

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to www" stopProcessing="true">
<match url="(.*)" />
<conditions trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^domain.com$" />
</conditions>
<action type="Redirect"
url="{MapProtocol:{HTTPS}}://www.domain.com/{R:1}" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="MapProtocol">
<add key="on" value="https" />
<add key="off" value="http" />
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
</configuration>

原文地址:https://www.cnblogs.com/zwei1121/p/3401153.html