(FreeBSD) 自訂 HTTP 錯誤訊息 |
|
jackkcg
站務副站長 發表:891 回覆:1050 積分:848 註冊:2002-03-23 發送簡訊給我 |
苗栗縣大湖鄉大南國民小學全球資訊網路 (FreeBSD) 架站日誌
--------------------------------------------------------------------------------
本文件僅供本站自主維修之用,若您操作時出了問題,請恕本站無法提供任何協助,因為這只是一篇私人的筆記而以。
自訂 HTTP 錯誤訊息
[an error occurred while processing this directive]
本文件最後的修改日期:Saturday July 21, 2001
-------------------------------------------------------------------------------- httpd.conf中有一段設定如下:
#
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "The server made a boo boo.
# n.b. the single leading (") marks it as text, it does not get output
#
# 2) local redirects
#ErrorDocument 404 /missing.html
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# N.B.: You can redirect to a script or a document using server-side-includes.
#
# 3) external redirects
#ErrorDocument 402 http://some.other_server.com/subscription_info.html
# N.B.: Many of the environment variables associated with the original
# request will *not* be available to such a script. 我改成這樣子:
#
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "The server made a boo boo.
# n.b. the single leading (") marks it as text, it does not get output
#
# 2) local redirects
#ErrorDocument 404 /missing.html
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# N.B.: You can redirect to a script or a document using server-side-includes.
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
#
# 3) external redirects
#ErrorDocument 402 http://some.other_server.com/subscription_info.html
# N.B.: Many of the environment variables associated with the original
# request will *not* be available to such a script. 您可以一眼就看出我是使用第二種方法,而且文件中還特別強調可以「using server-side-includes」。 403.html 及 404.html 位於 DocumentRoot 所定義的資料夾中。至於內容怎麼寫,就看您個人的 HTML 風格了。 範例網頁:
403 - Forbidden
404 - Not Found 若無法顯示自訂的錯誤訊息時,請關閉 IE 「顯示易懂的 HTTP 錯誤訊息」的功能。 ***************************************************************************
哈哈&兵燹
------
********************************************************** 哈哈&兵燹 最會的2大絕招 這個不會與那個也不會 哈哈哈 粉好 Delphi K.Top的K.Top分兩個字解釋Top代表尖端的意思,希望本討論區能提供Delphi的尖端新知 K.表Knowlege 知識,就是本站的標語:Open our mind |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |