我一直在試圖讓我的web應用重定向到自定義404頁面。它適用於所有網址,除非它們具有「.aspx」擴展名.aspx擴展的自定義404頁面錯誤
服務器是Windows Server 2008,以下是我在web.config中的設置(以google.com爲例):
<customErrors defaultRedirect="http://www.google.com" mode="On" redirectMode="ResponseRedirect"></customErrors>
<httpErrors errorMode="Custom">
<clear />
<remove statusCode="500" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404-Page/" responseMode="ExecuteURL" />
<error statusCode="500" prefixLanguageFilePath="" path="/404-Page/" responseMode="ExecuteURL" />
</httpErrors>
再次HTTP錯誤的一切,但「的.aspx」
我試過了。仍然會遇到同樣的問題。 – Channafow
當您在瀏覽器中輸入一個不存在的.aspx文件的URL時會發生什麼? – DaveB
只需進入常規ASP錯誤頁面,而不是我的自定義頁面。 – Channafow