web.config not forwarding to 404 error page on non .aspx pages

后端 未结 2 576
栀梦
栀梦 2021-01-17 12:52

Objective

I want all URLs of missing pages to forward to my 404 page which is in my root as 404error.aspx

Problem

So far only the UR

2条回答
  •  暖寄归人
    2021-01-17 13:23

    You need to configure the element. This configures the error pages for both static files and server pages.

    Your 3rd attempt "web.config (3)" and "Edit 1" are almost there. The problem is that you can't use app-relative paths here (ex: "~/404.html"), they have to be relative from the site root (ex: "/404.html").

    
    
       
          
            
                  
                            
            
              
            
              
            
                            
            
          
       
    
    

提交回复
热议问题