title: RequestReduce And ReWriting CSS Paths
body: <p>I've recently implemented RequestReduce on a site we have in development.</p>
  
  <p>It's working well except for one behavior that's proving problematic. I noticed that ReduceRequest rewrites the paths of background images, for example, to be a full path instead of relative. This is a problem for this application because it contains a css style (from a common, shared site and style sheet, via a virtual directory) that contains an .htc file fix for IE pngs. (I know, I know, don't ask me why we still do this).</p>
  
  <p>When RequestReduce re-writes the style, the style becomes</p>
  
  <pre><code>img.pngfix,div.pngfix img{behavior:url(http://[domain]/_common/htc/iepngfix.htc)}
  </code></pre>
  
  <p>(_common is a virtual directory to our common includes site)</p>
  
  <p>This throws a permission denied error in IE as you can't use htc from an external domain the way I understand it (it does function as expected without the domain).</p>
  
  <p><img src="https://i.stack.imgur.com/8Ec29.png" alt="enter image description here"></p>
  
  <p>So I've been trying to come up with a way to have RequestReduce <em>not</em> re-write the CSS rules to add domain. Parsing through the documentation I came across this:</p>
  
  <p><a href="https://github.com/mwrock/RequestReduce/wiki/The-RequestReduce-Api" rel="nofollow noreferrer">https://github.com/mwrock/RequestReduce/wiki/The-RequestReduce-Api</a>
  (specifically, the section labelled Transforming the URLs generated by RequestReduce)</p>
  
  <p>The API seems to indicate this can be done with something like the following:</p>
  
  <pre><code>RequestReduce.Api.Registry.UrlTransformer =
                      (context, x, y) =&gt;
                      y.Replace("[http://domain]", "");
  </code></pre>
  
  <p>But so far, I've never seen this work. It never actually replaces the domain portion with nothing as I'm requesting.</p>
  
  <p>I've also posted on this bug thread which seems to indicate that there is an issue with this functionality: <a href="https://github.com/mwrock/RequestReduce/issues/177" rel="nofollow noreferrer">https://github.com/mwrock/RequestReduce/issues/177</a></p>
  
  <p>Does anyone have any experience with ReduceRequest and URL transformations? I'm hoping to verify I'm not doing anything improperly as I'm pretty new to the tool. This tool would be a definite win for our applications so I'm hoping to be able to work around this.</p>
  
  <p>Thanks for any help you can offer.</p>