Default redirect for Error 404

前端 未结 4 1491
栀梦
栀梦 2020-12-01 06:19

I want to introduce a functionality in my ASP.net website that, whenever a request is received for an unknown URL on my domain, the user is redirected to my error_404.

4条回答
  •  猫巷女王i
    2020-12-01 06:56

    You can point your users to a custom 404 by including the customErrors section in your web.config.

    
         
    
    

    As others have stated in the comments above, sending users back to your homepage is going to be not only annoying but functionally confusing.

    My advice would be to send the user to a page that gives them some information about what's happened and offers them a next step (browse other products, go back to your dashboard etc).

提交回复
热议问题