title: Custom error pages based on path/url in ASP.NET MVC
body: <p>Is it possible to have a custom error page based on URL or path?  For example, I want any 404 errors that happen under /images, /styles, /javascript to fail very fast with a standard 404 not found.  However, anything else should generate a user-friendly custom 404 (which may be a little heavier response, being a user-friendly page with normal page layout elements).  Is this possible?  Right now I am using something like this:</p>
  
  <pre><code>&lt;httpErrors errorMode="Custom" existingResponse="Replace"&gt;
    &lt;remove statusCode="404" subStatusCode="-1" /&gt;
    &lt;error statusCode="404" path="/notfound" responseMode="ExecuteURL" /&gt;
  &lt;/httpErrors&gt;
  </code></pre>
  
  <p>But this captures <em>all</em> 404 errors.</p>