title: Rewrite rules in ISS's web.config
body: <p>I'm just trying to get some code running on ISS that has been running on Apache for a long time.</p>
  
  <p>A particular mod_rewrite rule is proving difficult to get working.</p>
  
  <p>In Apache I've used:</p>
  
  <pre><code>RewriteRule ^media/(js|css|img|font)/(.+)\.(\d+)\.(js|css|png|jpg|gif)$ /media/$1/$2.$4 
  </code></pre>
  
  <p>[L]</p>
  
  <p>To turn a URL like <code>/media/css/style.1367406756.css</code> into <code>/media/css/style.css</code>, letting me put timestamps in the files to avoid caching issues.</p>
  
  <p>In my web.config file I've added:</p>
  
  <pre><code>&lt;rule name="Cache bust assets" stopProcessing="true"&gt;
      &lt;match url="^(.*)$"/&gt;
      &lt;conditions&gt;
      &lt;add input="{URL}" pattern="^media/(js|css|img|font)/(.+)\.(\d+)\.(js|css|png|jpg|gif)$"/&gt;
      &lt;/conditions&gt;
      &lt;action type="Rewrite" url="/media/{R:1}/{R:2}.{R:4}" appendQueryString="true" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>Which, looks like it should work. (It's alongside another rule, which works fine, so it's not that the server isn't parsing it or anything).</p>
  
  <p>I don't get any errors, other than visiting <code>/media/css/style.1367406756.css</code> gives me a 404 error.</p>
  
  <p>How Can I make this work?</p>