title: Setting up IIS7 Custom 404 Pages to "execute" aspx page in a classic App Pool
body: <p>I have a piggy back question off of @Mike C's <a href="https://stackoverflow.com/questions/5070695/accessing-original-url-in-iis7-404-redirect-page">question</a> I have implemented what is in @rsbarro's answer. The asp.net custom error works fine, it's the IIS custom errors which doesn't want to work for me. I've found that the only way it wants to work is if I set the error to redirect to the custom 404 page, however, that's less than ideal since I need the original requested url. Below is what I have in my web.config.</p>
  
  <p>For asp.net Custom Error Pages:</p>
  
  <pre><code>    &lt;customErrors mode="On"&gt;
          &lt;error statusCode="404" redirect="/404.aspx" /&gt;
          &lt;error statusCode="500" redirect="/500.aspx" /&gt;
      &lt;/customErrors&gt;
  </code></pre>
  
  <p>The above works just fine. And for IIS Custom Errors (which does not work).</p>
  
  <pre><code>&lt;system.webServer&gt;
        ...
        &lt;httpErrors errorMode="Custom"&gt;
          &lt;remove statusCode="404" subStatusCode="-1" /&gt;
          &lt;error statusCode="404" path="/auto404.aspx" responseMode="ExecuteURL" /&gt;
        &lt;/httpErrors&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p>Running IIS7 in a classic app pool (can't use integrated because of Sitecore CMS), any ideas? </p>