Skip to content

Instantly share code, notes, and snippets.

@rbaty-barr
Last active July 19, 2017 17:02
Show Gist options
  • Save rbaty-barr/f713c6fb0f0510c2333d63334ece31bd to your computer and use it in GitHub Desktop.
Save rbaty-barr/f713c6fb0f0510c2333d63334ece31bd to your computer and use it in GitHub Desktop.
Rewrite rules example for web.config
<rewrite>
<rules>
<rule name="orgRewrite" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^www\.(.+)$" />
</conditions>
<action type="Redirect" url="http://{C:1}/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
<rule name="Redirects umbraco.io to actual domain" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(.*)?.s1.umbraco.io$" />
<add input="{REQUEST_URI}" negate="true" pattern="^/umbraco" />
<add input="{REQUEST_URI}" negate="true" pattern="localhost" />
</conditions>
<action type="Redirect" url="http://ilpf-supportyourfund.org/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment