title: Using URL Routing for Web Forms and StopRoutingHandler for Favicon
body: <p>I have a website where I need to add a Favicon.ico.  The site is written using ASP.NET 3.5 Web Forms with Routing.  The issue is that the Favicon link always returns a page not found error.  This is because the Routing does not know where the link for Favicon.ico should go to so it returns the Not Found page.  </p>
  
  <p>I have tried to add a StopRoutingHandler for the the favicon but none of them seem to work.  Below are the ones I have tried so far:</p>
  
  <pre><code>routes.Add(new Route("MasterPages/{favicon}.ico", new StopRoutingHandler()));
  routes.Add(new Route("{favicon}.ico", new StopRoutingHandler()));
  routes.Add(new Route("favicon.ico", new StopRoutingHandler()));
  routes.Add(new Route("favicon.ico/{*pathInfo}", new StopRoutingHandler()));
  </code></pre>
  
  <p>Does anyone know what I should be using?  My favicon.ico links I have tried look like this:</p>
  
  <pre><code>&lt;link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /&gt;
  &lt;link rel="icon" href="/favicon.ico" type="image/x-icon" /&gt;
  </code></pre>
  
  <p>And they are inside of my <code>&lt;html&gt;&lt;head&gt;</code> tags.</p>
  
  <p>Also, as one final note, I am not using MVC because if I was I could use this:</p>
  
  <pre><code>routes.IgnoreRoute("{*favicon}", new {favicon=@"(.*/)?favicon.ico(/.*)?"});
  </code></pre>
  
  <p>Unfortunately, IgnoreRoute does not work for Routing Web Forms though because it is not an MVC application.</p>