在根目录web.config文件添加
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^xxx.com$" />
</conditions>
<action type="Redirect" url="http://www.xxx.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
然后这个网址查询一下就可以知道是不是配置成功了
http://tool.chinaz.com/pagestatus/
真搞不懂现在还有人用iis,劝那些还在用的,赶紧换了吧, 这也就是做个记录吧