在 Linux 伺服器上設定自訂錯誤頁面

配置 web 伺服器以顯示網站的自訂錯誤頁面:

  1. 打開自訂錯誤文檔支援。
    1. 請轉到 網站與域名 標籤,並在網頁設定窗格中按一下 主機設定
    2. 選擇 自訂錯誤文檔 核取方塊。
    3. 點按 確定
  2. 連接至您的 FTP 帳號,並轉到 error_docs 目錄。
  3. 編輯或替換相應的檔。請確定保留正確的檔案名:
    • 400 錯誤的檔請求 - bad_request.html
    • 401 未授權 - unauthorized.html
    • 403 禁止/拒絕存取 - forbidden.html
    • 404 未找到 - not_found.html
    • 405 方式不允許 - method_not_allowed.html
    • 406 不接受 - not_acceptable.html
    • 407 需要代理認證 - proxy_authentication_required.html
    • 412 預置條件失敗 - precondition_failed.html
    • 414 請求 URI 過長 - request-uri_too_long.html
    • 415 不支援媒體類型 - unsupported_media_type.html
    • 500 內部伺服器錯誤 - internal_server_error.html
    • 501 未執行 - not_implemented.html
    • 502 錯誤閘道 - bad_gateway.html
    • 503 服務暫時無法使用 - maintenance.html

此後 web 伺服器將顯示自訂錯誤頁面。