Custom 404 Error Page
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.
Environment
- OS: Arch Linux
- Apache Server
404 Template
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.
Configuration
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:
1 | ErrorDocument 500 "Sorry, our script crashed. Oh dear" |
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:
1 | # Multi-language error messages |
Restart the http.service.
Done!