Why does the ASP.NET error page return 404 as soon as the aspxerrorpath querystring is present?
<p>I have configured an ASP.NET application as follows:</p>

<pre><code>&lt;customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx"/&gt;
</code></pre>

<p>When I browse to the ~/Error.aspx file the server returns 200 and the page is rendered. But if the user is redirected to the error page a querystring is appended to the path:</p>

<p>/Error.aspx?aspxerrorpath=/Test.aspx</p>

<p>But whenever this querystring is used the server doesn't render the error page, instead it returns a 404 using the server's custom error page, not Error.aspx</p>

<p>Why doesn't the web.config setting result in ~/Error.aspx being rendered?</p>
