views:

48

answers:

2

Hi,

I need to put my Drupal Site in offline/maintenance mode whence my SQL server is undergoing maintenance. I cant change the settings for offline mode in Drupal database because MYSQL would be inaccessible.

Any other method to do it?

Thanks in advance!

+2  A: 

Add $conf['site_offline'] = 1; to the config file for your site.

Caleb
@Caleb, if the database is under maintenance, the site on load gives a database error inspite of this setting. Any other alternatives possible?
Loveleen Kaur
wildpeaks suggestion is correct that you will need to bypass drupal entirely if your actually breaking something behind the scenes like that. An apache config/redirect solution is in order. However, it should NEVER be necessary to take your database SERVER offline like that. Even if structures are being updated or you are doing backups there should not be a need to cut it off entirely!
Caleb
+1  A: 

You could use htaccess (for Apache, or the equivalent in IIS Manager) to redirect to a non-drupal page during database maintenance, otherwise it will indeed show a database error even in "offline" mode, preferably a "302" type of redirect.

wildpeaks