I’m trying to change the default Apache 404 message/page on my lab computer. Here, I will share my experience though it is simple.
- OS: Arch Linux
- Apache Server
I found some good-looking templates on 20 Best Easy To Use Free 404 Error Page Templates. They are free and well-designed, and I chose one of them which is my cup of tea.
The only thing I need to do is to modify the configuration file of Apache httpd. i.e.
/etc/httpd/conf/httpd.conf file in my computer.
According to the guidance in
httpd.conf file, custom your error page like this:
ErrorDocument 500 "Sorry, our script crashed. Oh dear"
ErrorDocument 500 /cgi-bin/crash-recover
ErrorDocument 500 http://error.example.com/server_error.html
ErrorDocument 404 /errors/not_found.html
ErrorDocument 401 /subscription/how_to_subscribe.html
There is a setting which implements multi-language error documents through content-negotiation. It will prevent the error page setting from working properly. Comment out the include:
# Multi-language error messages
Restart the http.service.