How to prevent “aspxerrorpath” being passed as a query string to ASP.NET custom error pages

If you supply your own query string variable when specifying the path, then .NET will NOT tack on the “aspxerrorpath”. Who knew?

For example:

<customErrors mode="On" defaultRedirect="errorpage.aspx?error=1" >

This will do the trick.
I had to add this to a bunch of apps since URLScan for IIS by default rejects anything with “aspxerrorpath” in it anyway.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)