Drupal: How to Turn Your Site Off-Line for Maintenance
When you site is in “Online” mode, all site visitors can view the site pages as usual. In “Offline” mode, only users who can control site settings have access to the site. Other visitors will see an adjustable message that the site currently doesn’t work. Registered users will be able to login to the off-line site through login page (example.com/user).
Solutions:
- Turn the site off-line through web-interface
- Turn the site off-line through settings.php file
- Turn the site off-line with the help of SQL-request
Turn the site off-line through web-interface
- open this page in browser:
- Drupal 4: admin/settings
- Drupal 5: admin/settings/site-maintenance
- Drupal 6: admin/settings/site-maintenance
- Select “Maintenance“
- Check text of the message that will appear for all visitors during the site is off-line
- Save your changes
Turn the site off-line through settings.php file
- Open settings.php file
- uncomment $conf variable
- Add array element
'site_offline'=>1
Turn the site off-line with the help of SQL-request
Run SQL-request:
UPDATE variable SET value = ‘s:1:”1″;’ WHERE name= ‘site_offline';
DELETE FROM cache WHERE cid = ‘variables';