title: How to prevent "aspxerrorpath" being passed as a query string to ASP.NET custom error pages
body: <p>In my ASP.NET web application, I have defined custom error pages in my web.config file as follows:</p>
  
  <pre><code>&lt;customErrors mode="On" defaultRedirect="~/default.html"&gt;
       &lt;error statusCode="404" redirect="~/PageNotFound.html" /&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>In the case of a 404 error, my site redirects to the <code>default.html</code> page, but it passes "aspxerrorpath" as a query string parameter to the custom error page as follows:</p>
  
  <pre><code>http://www.example.com/default.html?aspxerrorpath=/somepathcausederror/badpage.aspx
  </code></pre>
  
  <p>I don't want that behavior.  I want the redirect URL to simply read:</p>
  
  <pre><code>http://www.example.com/default.html
  </code></pre>
  
  <p>Is there a way to achieve this? </p>