[drupal-devel] Re: [CS dev] Worth a look: Symphony

Gabor Hojtsy gabor at hojtsy.hu
Thu Sep 29 22:16:01 UTC 2005


> To give you a quick idea, here is how my modified index.php looks like:
> 
> $maintenance = FALSE;
> 
> require_once './includes/bootstrap.inc';
> drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
> 
> if ($maintenance && $user->uid != 1) {
>   drupal_set_title("We'll be right back");
>   print theme('maintenance_page', 'Drupal.org is being upgraded.  We 
> should be back in a jiffy.');
> }
> else {
>   $return = menu_execute_active_handler();
>   switch ($return) {
>     case MENU_NOT_FOUND:
>       drupal_not_found();
>       break;
>     case MENU_ACCESS_DENIED:
>       drupal_access_denied();
>       break;
>     default:
>       if (!empty($return)) {
>         print theme('page', $return);
>       }
>       break;
>   }
>   drupal_page_footer();
> }
> 
> I'm certainly going to leave that in.  It's simple, handy, and the  only
> effective way to shortcut all visitors.  A non-developer would  not be
> able to figure that out.  I leave it up to you guys whether  that needs
> to be extended and committed.

What is important that this maintanance mode reply *should not* be a
HTTP 200 OK reply. What we have done on a site is to return an "503
Service unavailable" status code and a maintatance message, so that the
message is not going to be indexed in search engines (which is quite
unprofessional :), and it is not going to be tried to be parsed as RSS
by a newsreader, etc.

Goba



More information about the drupal-devel mailing list