title: Custom error pages shown using IIS6 rather than web.config settings
body: <p>this is my first post on this great source of programming information.</p>
  
  <p>I have developed new site for client and just doing some finishing touches. </p>
  
  <p>I am trying to create custom error pages which would be read from <strong>web.config</strong></p>
  
  <pre><code> &lt;system.web&gt;
   &lt;customErrors mode="RemoteOnly"&gt;
             &lt;error statusCode="404" redirect="404.aspx" /&gt;
             &lt;error statusCode="500" redirect="500.aspx" /&gt;
      &lt;/customErrors&gt;
  </code></pre>
  
  <p>It works well on local development machine and 404 and 500 errors are shown as required. </p>
  
  <p>After compilation and publishing site to web server it doesnt work. IIS 6 keeps on showing original IIS 6 error pages like this 404 error:</p>
  
  <pre><code>The page cannot be found
  
  The page you are looking for might have been removed, 
  had its name changed, or is temporarily unavailable. 
  Please try the following:
  
  Make sure that the Web site address displayed in the address bar of 
  your browser is spelled and formatted correctly.
  
  If you reached this page by clicking a link, contact the Web site 
  administrator to alert them that the link is incorrectly formatted.
  
  Click the Back button to try another link.
  HTTP Error 404 - File or directory not found.
  Internet Information Services (IIS)
  </code></pre>
  
  <p>I am not sure why is it doing this, I thought that web.config overwrites original IIS6 settings.</p>
  
  <hr>
  
  <p>Ok I have found out that the problem is with the 404 .aspx page only. Error 500 is working fine and showing 500.aspx page. But not for 404.aspx. Please advice</p>