Skip to content

Instantly share code, notes, and snippets.

@steveobbayi
Created January 23, 2017 09:20
Show Gist options
  • Save steveobbayi/ad7fb3d3adbac5eca32cf8d8fd0333e4 to your computer and use it in GitHub Desktop.
Save steveobbayi/ad7fb3d3adbac5eca32cf8d8fd0333e4 to your computer and use it in GitHub Desktop.
<?php // custom WordPress database error page
// Tell the browser that there is a bit of a mess on the server
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 600'); // in seconds = 10 minutes
// You can send yourself an email notification
mail("your@email.com", "Database Connection Error", "Problem with the database! Come fix me!", "From: My Website's DB");
// Put out the customized friendly template that matches your website
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Database Connection Error</title>
<style>
/*
Any required CSS rules here
*/
</style>
</head>
<body>
State what you going through in a public friendly way.
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment