Last updated July 4, 2011. Created on July 4, 2011.
Edited by zackhawkins0103. Log in to edit this page.

This is a weird fix for showing an html file as the maintenance page without having the name of the maintenance file show up in the address bar, allowing users to refresh the page. You can set a custom offline.html file in "root/themes/garland/page.tpl.php" or the path to the page.tpl.php file in the default maintenance theme, default is Garland. by using this php section:

function phptemplate_maintenance_page($content, $messages = TRUE, $partial = FALSE) {

This is a custom theme, and everything for your site, but it comes up as which doesn't allow the user to refresh the page easily.

In option 2 you retain the theme you desire, but it doesn't always work with the theme, and it doesn't allow you to use a custom theme. You will need chmod the settings.php file located in the "root/sites/default" directory in order to have read, write, and execute privileges. You will then un-comment three lines and change "garland" to the theme you want to use for the maintenance page.

1) #   $conf = array(
2) #   'maintenance_theme' => 'minnelli',
3) #   );


1)     $conf = array(
2)     'maintenance_theme' => 'minnelli',
3)     );

This will get you the theme that can match your site or any other theme, but it doesn't always work properly with certain themes, and it doesn't offer a whole lot of flexibility to the .css files or html content.

In option number 3 it allows you to use a completely custom html page as the offline page, without showing the file.html extension it remains on the page it was previously on. In this option follow the guide of option 2, except for the theme you picture shouldn't contain maintenance-page.tpl.php or maintenance-page-offline.tpl.php. After you have the settings.php page set up download the page.tpl.php and make another duplicate of it. Name these two files "maintenance-page.tpl.php" and "maintenance-page-offline.tpl.php". Delete all the content in these files and create these lines in both:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>">

= 'Site Offline';
$content =

  <title><?php print $head_title ?></title>
  <?php print $content ?>
    <!--[if lt IE 7]>
    <style type="text/css" media="all">@import "<?php print base_path() . path_to_theme() ?>/fix-ie.css";</style>
  <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?></script>

= "width";
$theme_width = theme_validate_page_width($theme_width);


note: make sure to replace theme with you desired theme you want to use in the bottom php section.

Generate a .html file with the .css configurations you want pre-determined in the file for example:

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' ''>
<html lang='en-US'><head><title>site is Offline</title>
<link rel='alternate' type='application/rss+xml' title='' href=''>
<link rel='SHORTCUT ICON' href='sites/default/files/favicon.ico'>
<style>body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 76%;
color: #000;
margin: 20px;
background: #292929;
text-align: center;
color: #EFEFEF;
font-weight: bold;
a:link {
a:visited {
a:active {
h2 {
font-size: 1.5em;
border-bottom: 1px solid silver;
padding-bottom: 3px;
clear: both;
pre {
        max-height: 240px.........

This allows for a custom .css configurations for the site, and then finish it off with your html:

<div class='logo'><a href=''><img src='sites/default/files/sitelogo.png'
<div class='content'>
<div class='footer'>

After you have the html ready for the "site is offline page" and the "site maintenance page", replace all ' with " inside of the html, and surround them with ', or you can do this the other way around. If both are absolutely required in the html, you can use &#39; for ' and &quot; for ". After you have that all squared away paste the file contents after the ' = ' (make sure to leave a space after the =) in the '$content = ' line, and add a ; after the html.
Thank you for your time, and I hope you found this tutorial informative. :)

Looking for support? Visit the forums, or join #drupal-support in IRC.


gagarine’s picture

I don't get really what this page is all about... I think this is a better page