title: ASP.NET web forms- custom error page for 404 error is working only when asking .aspx pages
body: <p>I added a custom error page to handle 404 errors.</p>
  
  <pre><code> &lt;customErrors mode="On" defaultRedirect="Error.aspx"&gt;
    &lt;error statusCode="404" redirect="Error.aspx"/&gt;
    &lt;error statusCode="500" redirect="Error.aspx"/&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>The problem is that this works only when I try to access a .aspx page like</p>
  
  <pre><code>localhost/abcd.aspx
  </code></pre>
  
  <p>where abcd.aspx is not a real page in the app.
  however, when I try to access just <code>localhost/abcd</code> it throws me the default IIS error page and not the custom page I made.
  How can I config my custom error page to catch all 404 errors?</p>