1 頁 (共 1 頁)

[小筆記] Ubuntu 之更改Apache 404 Not Found 錯誤頁面

發表於 : 2013-03-01, 13:32
tony
終端機中輸入 sudo gedit /etc/apache2/apache2.conf

在最底下加入一段 ErrorDocument 404 欲顯示的錯誤頁面位址

這時你要確定在預設的網頁根目錄裡已經有相對應的頁面可顯示

範例:ErrorDocument 404 /404.html

那麼在 /var/www 底下應該要新增一個 404.html 頁面

範例:sudo gedit /var/www/404.html

最後終端機執行 sudo /etc/init.d/apache2 restart 重新啟動 Apache 就完成囉。