2011-06-06 42 views
1

我有一個頁面的404錯誤和response.status是404 昨天response.Addheader工作正常,但今天它只是顯示一個空白頁,如果我檢查頭狀態它是404.response.Addheader不工作

這裏是我在同一個代碼代碼

Response.Status="404 Not Found" 
Response.AddHeader "Location", domain & "/page-not-found" 

部分 - 301個狀態正常工作

IIS 7,VB腳本,傳統的ASP

+0

位置頭只運行狀態碼等於3XX等,它的客戶關係。也許這是由於緩存。 – 2011-09-06 05:38:32

回答

1

你可以編輯你的web.config重定向到那裏... 404

<configuration> 
    <system.web> 
     <customErrors defaultRedirect="/page-not-found" 
        mode="RemoteOnly"> 
     <error statusCode="404" 
       redirect="/page-not-found"/> 
     </customErrors> 
    </system.web> 
</configuration> 

來源:Web.config custom errors