Tuesday, June 19, 2012

WpRecipes.com

WpRecipes.com


How to create a custom database error page

Posted: 19 Jun 2012 07:21 AM PDT

Paste the code below into a new file. Name it db-error.php and save it on your wp-content directory. In case of a database error, WordPress will automatically use this file.

  <?php // custom WordPress database error page      header('HTTP/1.1 503 Service Temporarily Unavailable');    header('Status: 503 Service Temporarily Unavailable');    header('Retry-After: 600'); // 1 hour = 3600 seconds      // If you wish to email yourself upon an error    // mail("your@email.com", "Database Error", "There is a problem with the database!", "From: Db Error Watching");    ?>    <!DOCTYPE HTML>  <html>  <head>  <title>Database Error</title>  <style>  body { padding: 20px; background: red; color: white; font-size: 60px; }  </style>  </head>  <body>    You got problems.  </body>  </html>  

Thanks to CSS Tricks for the tip!

No comments:

Post a Comment

Search This Blog

Top WordPress Seller