Skip to content

Instantly share code, notes, and snippets.

@srkirkland
Created August 5, 2014 22:56
Show Gist options
  • Save srkirkland/657566fb26e1179d73ed to your computer and use it in GitHub Desktop.
Save srkirkland/657566fb26e1179d73ed to your computer and use it in GitHub Desktop.
url rewrite
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="site.ucdavis.edu" ignoreCase="true" />
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://site.ucdavis.edu/{R:1}" />
</rule>
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="MapProtocol">
<add key="on" value="https" />
<add key="off" value="http" />
</rewriteMap>
</rewriteMaps>
</rewrite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment