zwei1121

博客园 首页 新随笔 联系 订阅 管理

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>

posted on 2013-11-01 10:33  zwei  阅读(224)  评论(0编辑  收藏  举报