title: How to prevent not found error when image doesn't exist in .NET MVC
body: <p>I have an MVC application and my error handling is set up like this in web.config:</p>
  
  <pre><code>&lt;customErrors mode="On" defaultRedirect="~/Error/" redirectMode="ResponseRedirect"&gt;
      &lt;error statusCode="404" redirect="~/Error/NotFound/" /&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>Every time a request for non existing image comes my NotFound action on Error controller is being hit, and I get an error <code>The controller for path '/img/home/myimg.jpg' was not found or does not implement IController.</code> logged.</p>
  
  <p>I added <code>RouteTable.Routes.IgnoreRoute("img/");</code> to my <code>Global.asax</code> but it doesn't help. 
  How can I make MVC to ignore all requests to any files?</p>
  
  <p>Thanks</p>