Skip to content

Instantly share code, notes, and snippets.

View cfallesen's full-sized avatar

Carsten Fallesen cfallesen

View GitHub Profile
// Use whatever namespacing works for your project.
namespace YourSite.Web.Controllers.Api
{
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@cfallesen
cfallesen / redirect.xml
Last active August 29, 2015 14:25 — forked from uniquelau/redirect.xml
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" />