Skip to content

Instantly share code, notes, and snippets.

@nickspiers
Last active December 19, 2015 18:58
Show Gist options
  • Save nickspiers/6002568 to your computer and use it in GitHub Desktop.
Save nickspiers/6002568 to your computer and use it in GitHub Desktop.
301 IIS Rewrite Module for Legacy URLS
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect rule for Redirects">
<match url=".*" />
<conditions>
<add input="{Redirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="Redirects">
<add key="/work.aspx" value="/our-work" />
<add key="/services.aspx" value="/services" />
<add key="/default.aspx" value="/" />
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment