Drupal: .htaccess Access Deny
August 21, 2012 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

First let’s speak about Order directive of .htaccess file of Apache server.
Description: …

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.


Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.


Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How to Turn Your Site Off-Line for Maintenance

Submitted by on October 29, 2010 – 7:55 amNo Comment

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).

  • 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

  1. open this page in browser:
    • Drupal 4: admin/settings
    • Drupal 5: admin/settings/site-maintenance
    • Drupal 6: admin/settings/site-maintenance
  2. Select “Maintenance
  3. Check text of the message that will appear for all visitors during the site is off-line
  4. Save your changes

Turn the site off-line through settings.php file

  1. Open settings.php file
  2. uncomment $conf variable
  3. 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’;

Disallow users enter to the site when it is offline.

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.