Skip to content

Instantly share code, notes, and snippets.

@cfallesen
Forked from uniquelau/redirect.xml
Last active August 29, 2015 14:25
Show Gist options
  • Save cfallesen/26bca3c6c130bac859a1 to your computer and use it in GitHub Desktop.
Save cfallesen/26bca3c6c130bac859a1 to your computer and use it in GitHub Desktop.
Quick Redirect to Production Media, for Media Heavy Sites
<!-- IIS URL Rewrite, this can be placed in the web.config -->
<!-- Handle Missing Media on Development Environment -->
<rule name="Handle missing media" stopProcessing="true">
<match url="^media/(.*)" />
<conditions logicalGrouping="MatchAll">
<!-- Add Conditions, so local only -->
<add input="{REMOTE_HOST}" pattern="localhost" />
<!-- Handle Files and Folders -->
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Temporary" url="http://www.production.domain/{R:0}" appendQueryString="true" />
</rule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment