Skip to content

Instantly share code, notes, and snippets.

@uniquelau
Last active August 29, 2015 14:23
Show Gist options
  • Save uniquelau/8821f2d3b63c8b3b83ae to your computer and use it in GitHub Desktop.
Save uniquelau/8821f2d3b63c8b3b83ae 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