Skip to content

Instantly share code, notes, and snippets.

@shengoo
Last active August 29, 2015 14:04
Show Gist options
  • Save shengoo/f701ab81410f82795e58 to your computer and use it in GitHub Desktop.
Save shengoo/f701ab81410f82795e58 to your computer and use it in GitHub Desktop.
iis rewrite
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!--<rule name="Add www" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="test.com" />
</conditions>
<action type="Redirect" url="http://www.test.com/{R:0}" />
</rule>-->
<rule name="Add www" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^test.com$" />
</conditions>
<action type="Redirect" url="http://www.test.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment