title: ASP.net MVC favicon doesn't show up
body: <p>I need some help with showing the favicon on my site while using ASP.NET MVC.</p>
  
  <p>The problem in short is that whenever a request is made for </p>
  
  <ul>
  <li><a href="http://example.com/favicon.ico" rel="nofollow">http://example.com/favicon.ico</a> OR</li>
  <li><a href="http://example.com/Content/favicon.ico" rel="nofollow">http://example.com/Content/favicon.ico</a></li>
  </ul>
  
  <p>the request never gets served. Firefox says : </p>
  
  <blockquote>
    <p>Content Encoding Error - The page you
    are trying to view cannot be shown
    because it uses an invalid or
    unsupported form of compression.</p>
  </blockquote>
  
  <p>I have tried ignoring the route using the following ignore route strategies, obviously not all at the same time ;-)</p>
  
  <pre><code>routes.Add(new Route("favicon.ico", new StopRoutingHandler()));
  routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
  routes.IgnoreRoute("Content/{file}", new { file = @".*" });
  </code></pre>
  
  <p>I can confirm that it is ignoring the route because I subclassed the controller factory and it does not call <code>CreateController</code>
  The kicker is this, I also have a png version of the file and it does get served. I have also checked it with fiddler and whenever I try to request the ico directly through url I get a pop-up that says something like this:</p>
  
  <blockquote>
    <p>The magic number in GZip header is not
    correct. Make sure you are passing in
    a GZip stream.</p>
  </blockquote>
  
  <p>So it seems that somehow IIS is trying to send it back compressed?
  How do I stop this behavior/make it work?</p>
  
  <p>Any insights?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I figured it out, the web.config had a custom httpmodule that dealt with serving physical files and it was trying to compress the file output. That doesn't work when you have image files. :-)</p>