Closed (fixed)
Project:
Drupal core
Version:
6.16
Component:
base system
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
4 Mar 2010 at 01:52 UTC
Updated:
6 Jan 2012 at 13:44 UTC
MySQL trips quite a bit on my server and I have to reset the server. When it goes down, I get the "The site is currently not available due to technical problems. Please try again later. " page. I would like to take out the website is down code in the database.inc file (see below) and just have drupal redirect to a static html / non MySQL page elsewhere on my site so people can still see content. Any ideas?
function _db_error_page($error = '') {
global $db_type;
drupal_maintenance_theme();
drupal_set_header('HTTP/1.1 503 Service Unavailable');
drupal_set_title('Site off-line');
$message = '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>';
$message .= '<hr /><p><small>If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider\'s database server is running. For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>';
if ($error && ini_get('display_errors')) {
$message .= '<p><small>The '. theme('placeholder', $db_type) .' error was: '. theme('placeholder', $error) .'.</small></p>';
}
print theme('maintenance_page', $message);
exit;
}
Comments
Comment #1
buggs_moran commentedbump
Comment #2
gbaudoin commentedUse http://api.drupal.org/api/drupal/modules--system--maintenance-page.tpl.p...