Skip to content

Instantly share code, notes, and snippets.

@WordPress-Handbuch
Created April 23, 2019 06:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WordPress-Handbuch/aaa1edf0f2f3dbf9b9b44aaf36845342 to your computer and use it in GitHub Desktop.
Save WordPress-Handbuch/aaa1edf0f2f3dbf9b9b44aaf36845342 to your computer and use it in GitHub Desktop.
WordPress 5 dropin for db-error.php, a custom error message in case of a failed database connection
<?php ob_start();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
mail("info@ihredomain", "Datenbankfehler", "Schon wieder die Datenbank!", "From: Meine Website");
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Website nicht erreichbar</title>
</head>
<body>
<h1>Die Website ist leider gerade nicht erreichbar.</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment