IIS 7 Canonical URL redirect
问题 I would like to make a website always have www in the address, and enforce it via IIS rewrite. For example, test.com would become www.test.com. The typical example rewrite rule is: <rule name="Canonical Host Name" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" negate="true" pattern="^www\.test\.com$" /> </conditions> <action type="Redirect" url="http://www.test.com/{R:1}" redirectType="Permanent" /> </rule> However this requires me to enter the full url of