title: Display custom ASP.NET error page without rewriting URL
body: <p>Currently working on error pages for my website in ASP.NET. I'm using a web configuration file to redirect the user to an error page if the server was unable to find the requested page. Below is the customErrors tag I used in my configuration file:</p>
  
  <pre><code>&lt;customErrors mode="On" defaultRedirect="~/ErrorPages/Error.aspx"&gt;
    &lt;error statusCode="404" redirect="~/ErrorPages/Error.aspx"/&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>It's currently working but my problem is that I don't want the user to see my error page in the URL as displayed below:</p>
  
  <p>/MySite/ErrorPages/Error.aspx?aspxerrorpath=/MySite/ImaginaryPage.aspx</p>
  
  <p>I'm expecting something like what google has:
  <a href="http://google.com/ImaginaryPage.aspx" rel="nofollow">Google Error Page</a></p>
  
  <p>Is there a way to do this without Javascript?</p>