Apache’s default error pages are plain and unbranded — replacing them with custom pages is a small touch that meaningfully improves the experience when something does go wrong.
ErrorDocument 404 /errors/404.html ErrorDocument 500 /errors/500.html ErrorDocument 403 /errors/403.html # Can also point to a script for dynamic error pages ErrorDocument 404 /error-handler.php
<!DOCTYPE html>
<html>
<head><title>Page Not Found</title></head>
<body>
<h1>404 - We couldn't find that page</h1>
<p><a href="/">Back to homepage</a></p>
</body>
</html>
Keep custom error pages self-contained and lightweight (inline CSS, no external dependencies) — an error page that itself fails to load because it depends on a broken asset defeats the entire purpose, and this happens more often than you’d expect during real outages.