how can i change the message displayed on this page, i know what i have to do when there is an error, but i don't want every visitor to get a lesson about it...

Comments

pnlnl’s picture

bump, this is a serious problem..... thanks for any help

pnlnl’s picture

nobody interested???!!

how can i change the

unable to connect to database server error page

jonathan1055’s picture

Have a look at this thread http://drupal.org/node/152673

pnlnl’s picture

thanks for the link, but the situation has changed after i posted this, i discovered a solution which is "monit", now i can be sure that the ugly maintenance page won't be up for more than 1 minute 1m10s max, the sql server gets rebooted when it is killed, and after several reboots the whole system gets a reboot to ensure stability, I won't bother about hacking core to get this done because usually this ain't good, but on a second thought, i might only change the text that is displayed.......

wwwoliondorcom’s picture

Hello,

Have you found how to do on Drupal 6 ?

Thanks.

jonathan1055’s picture

It is easy in D6, just create a maintenance template file, put it in your theme's directory ie /sites/all/themes/yourtheme/ and modify it to contain anything you like. It should be named maintenance-page.tpl.php and it will be used when you put your site offline. Similarly maintenance-page-offline.tpl.php will be used when there is a problem and the database is unavailable. You can base your files on maintenance-page.tpl.php in /themes/garland/

I am using the zen theme, so I based mine on /sites/all/themes/zen/zen_classic/maintenance-page.tpl.php

You also need to specify which theme to use when the site is in maintenance mode, otherwise garland will be used. Do this by adding to the $conf array in your settings.php file. The array key 'maintenance_theme' and the value is your theme name:

 $conf = array(
/**
 * A custom theme can be set for the off-line page. This applies when the site
 * is explicitly set to off-line mode through the administration page or when
 * the database is inactive due to an error. It can be set through the
 * 'maintenance_theme' key. The template file should also be copied into the
 * theme. It is located inside 'modules/system/maintenance-page.tpl.php'.
 * Note: This setting does not apply to installation and update pages.
 */
   'maintenance_theme' => 'yourtheme',
);

Hope that helps you,

Jonathan