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

后端 未结 11 808
夕颜
夕颜 2020-12-29 03:36

In my ASP.NET web application, I have defined custom error pages in my web.config file as follows:



        
11条回答
  •  别那么骄傲
    2020-12-29 03:39

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

    For example:

    
    

    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.

提交回复
热议问题