最好的办法做一个301从非www到wwwredirect。 在IIS7.5中?

在IIS7.5中,从非www“somedomain.com”到“www.somedomain.com”redirect301的最佳方法是什么?

谢谢

    我build议你安装IIS 7的URL ReWrite模块来为你做这个。 你会添加一个看起来像这样的规则

    <rule name="Canonical Host Name" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" negate="true" pattern="somedomain\.com$" /> </conditions> <action type="Redirect" url="http://www.somedomain.com{R:1}" redirectType="Permanent" /> </rule> 

    有关URL ReWrite的一些提示和技巧,请参阅这篇文章 。