ASP.NET Custom Errors being ignored

前端 未结 3 1540
青春惊慌失措
青春惊慌失措 2021-01-21 22:07

I have custom errors configured in my web.config, but IIS 6.0 is returning the custom error specified in the Custom Errors tab of the website configuration.

  &l         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 22:47

    Bear in mind that the 404 handler specified in the web.config only kicks in for files handled by the ASP.NET runtime - .htm, images, css, javascript will all be handled by the 404 page specified in your hosts IIS settings.

    If you want these file types to be handled by your custom error, you'll need to set IIS to direct 404's to UrlRedirect.aspx.

提交回复
热议问题