Skip to content

Instantly share code, notes, and snippets.

@qutek
Created November 4, 2014 09:27
Show Gist options
  • Save qutek/508500cba8030b0bd8e6 to your computer and use it in GitHub Desktop.
Save qutek/508500cba8030b0bd8e6 to your computer and use it in GitHub Desktop.
[Wordpress] Custom error database connection page
<?php
/**
* Custom wordpress error database connection page
* @put this file on your wp-content/ folder.
* @name file : db-error.php
*
*/
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 600'); // 1 hour = 3600 seconds
/* Send email notification to admin */
// mail("[email protected]", "Database Error", "There is a problem with the database!", "From: Db Error Watching");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title>We got a Problem &mdash; Try later</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="description" content="This is a default index page for a new domain."/>
<style type="text/css">
body {font-size:10px; color:#777777; font-family:arial; text-align:center;}
h1 {font-size:64px; color:#555555; margin: 70px 0 50px 0;}
p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px }
div {width:320px; text-align:center; margin-left:auto;margin-right:auto;}
a:link {color: #34536A;}
a:visited {color: #34536A;}
a:active {color: #34536A;}
a:hover {color: #34536A;}
</style>
</head>
<body>
<h1>I'm sorry.. :(</h1>
<div>
<a>We got a problem</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment