title: Asp.net web.config Handle Error page "File or directory not found"
body: <p>I have page i.e. <strong>Default.aspx</strong>. I can handle error pages like 404,403. But when I change the extention of page then server give me an error.If I change <strong>Default.aspx</strong> to <strong>Default.asasd</strong>. Here I have just changed the extention of page then server gives following error</p>
  
  <p><img src="https://i.stack.imgur.com/1Bb5N.png" alt="Error Page"></p>
  
  <p>I added 404 error page in my web.config file. How can I solve this? </p>
  
  <p><strong>Web.config</strong></p>
  
  <pre><code>    &lt;customErrors mode="On" defaultRedirect="~/ErrorPages/DefaultErrorPage.aspx" redirectMode="ResponseRedirect"&gt;
          &lt;error statusCode="404"  redirect="~/ErrorPages/404.aspx" /&gt;
          &lt;error statusCode="403"  redirect="~/ErrorPages/403.aspx" /&gt;
     &lt;/customErrors&gt;
  </code></pre>