Use the ErrorDocument directive in your conf file to set a custom error message.
The easiest way to do this:
- Create a file with your custom error message. Save it in:
vim /var/www/not_found.html - Edit vim /etc/apache2/httpd.conf :
Find the line that says:
#ErrorDocument 404 /not_found.htmlRemove the leading “#”.
ErrorDocument 404 /not_found.htmlSave.
- Restart apache.
/etc/init.d/apache2 restart
Done!