ASP.NET / Web.config: customErrors redirect only on a 404

前端 未结 2 2107
时光说笑
时光说笑 2021-02-14 02:05

I have this scenario:

A user comes to my site and follows a link, which doesn\'t exists anymore, he should be redirected to a custom errorpage. (that works)

If a u

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-14 02:58

    In the following web.config entries, a not found (404) condition will send a user to PageNotFound.aspx

    Use mode="Off" and everyone (local and remote users) will see error details.

    
         
    
    

    Use mode="RemoteOnly" and local users will see detailed error pages with a stack trace and compilation details. Remote users with be presented with the GeneralError.aspx page

    
         
    
    

提交回复
热议问题