錯誤文檔的定位

常用的客戶端請求錯誤返回代碼:
  401 Authorization Required
  403 Forbidden
  404 Not Found
  405 Method Not Allowed
  408 Request Timed Out
  411 Content Length Required
  412 Precondition Failed
  413 Request Entity Too Long
  414 Request URI Too Long
  415 Unsupported Media Type

  常見的服務器錯誤返回代碼:
  500 Internal Server Error

用戶可以利用.htaccess指定自己事先製作好的錯誤提醒頁面。一般情況下,人們可以專門設立一個目錄,例如errors放置這些頁面。然後再.htaccess中,加入如下的指令:

  ErrorDocument 404 /errors/notfound.html
  ErrorDocument 500 /errors/internalerror.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章