2010-04-16 73 views
0

重定向我想重定向URL的所有錯誤我怎樣才能解決這個自定義錯誤在ASP.NET

我想導管的URL爲〜/ BLA /富

應該重定向到〜/ error404。 aspx

bla作爲文件夾存在。 foo不存在。

我已經設置了webconfig指向我的錯誤,但我只是不工作。我得到這個錯誤:

Server Error in application /. 
-------------------------------------------------- ------------------------------ 

The source can not be found. 
Description: HTTP 404. Perhaps you are looking for the source (or a dependency thereof)  removed or is temporarily unavailable or has changed its name. Check the spelling of the URL. 

Requested URL:/bla/foo.asox 

我谷歌翻譯此錯誤因爲VS這裏是語言特定。

我該怎麼做才能解決這個問題?我想點到〜/ error404.aspx

+0

錯誤表示您要在'/ bla/foo.asox',而不是'/ bla/foo'狀態。 – Oded 2010-04-16 10:03:28

回答

0

您還可以在IIS (this example is IIS 6)中配置自定義404頁面。這種方式請求任何不存在的資源將轉到您的自定義error404.aspx頁面。

如果有幫助,還有一個步行穿過screen shots here。這將是你在應用程序之外配置的東西。

相關問題