一般的網存都支持 .SHTML 自訂錯誤頁, 有的還會支援 .PHP。
例如想自訂「找不到網頁」的提示信息, 您只要做一個 404.shtml 或是 404.php
再把這個檔案上傳到 FTP 的根目錄即可, 檔案名中的 404 是指錯誤號。
其他常見錯誤
401 -> 未經認可, 未授權瀏覽 或是 登入失敗
403 -> 無權瀏覽
404 -> 找不到指定物件
500 -> 應用程式錯誤 或 伺服器錯誤
自架主機須作以下修改
打開 Apache 的 httpd.conf 文件, 新增新的一行, 加上:
ErrorDocument 404 /404.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 401 /401.shtml
ErrorDocument 500 /500.shtml
第一個數字組是 代表錯誤號, 後面的 /XXX.shtml 則是檔案檔的位置及名稱, 可使用任何 Apache 支持的文件, 如 PHP 。