UpTheCreek Asked: 2011-01-23 01:07:59 +0800 CST2011-01-23 01:07:59 +0800 CST 2011-01-23 01:07:59 +0800 CST Best way to do a 301 redirect from non-www to www. in IIS7.5? 772 What's the best way to do a 301 redirect from non-www 'somedomain.com' to 'www.somedomain.com' in IIS7.5? Thank you iis iis-7.5 301-redirect 1 Answers Voted Best Answer Sam Cogan 2011-01-23T02:36:00+08:002011-01-23T02:36:00+08:00 I would suggest that you install the URL ReWrite module for IIS 7 to do this for you. You would add a rule that looked soemthing like this <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> See this article for some hints and tips on URL ReWrite.
I would suggest that you install the URL ReWrite module for IIS 7 to do this for you. You would add a rule that looked soemthing like this
See this article for some hints and tips on URL ReWrite.