Showing the public a holding page while you develop or troubleshoot your site
While you develop your Drupal site you may want to show the public either a simple holding page or keep an older version of the site operational.
You can either develop Drupal in a subdirectory while keeping the site in place, or you can develop Drupal in the webroot and put the holding page or old site in a subdirectory. This page considers the latter approach.
This technique can also be used to display a more friendly message than the standard 'Can't connect to the database' message when your site goes down.
For a module-based approach, see http://drupal.org/project/holding.
Instructions
Create your static holding page(s) and place it in a subdirectory called, for example, 'holding'.
Then add the following lines to your Drupal installation's .htaccess file, below the 'RewriteEngine on' line:
##### rewriting for holding page
RewriteCond %{HTTP_HOST} mysite\.com [NC]
RewriteCond %{REQUEST_URI} !^/holding [NC]
RewriteCond %{HTTP_HOST} !^drupal [NC]
RewriteRule ^(.*)$ /holding/$1 [L]
##### end Replace 'mysite\.com' with the domain name of your own site, escaping the full stops with backslashes, as in the example.
This will redirect visitors of 'mysite.com' to 'mysite.com/holding', without them realising.
To access your Drupal site, you need an alternative domain name. There are two ways to do this.
- The easiest method is if you have the original domain name for your hosting, such as 'mysite.somehostingcompany.com'. Using this to reach your site will give you the Drupal site rather than the holding site. You may also be able to access your site at your IP like this: http://1.1.1.1/~username
- Alternatively, create a subdomain called 'drupal' for your site, set to the same webroot as the main domain. The third line in the code snippet above means that visiting 'drupal.mysite.com' won't be redirected to the holding page.
If you get a 403 for the holding site, you'll need to put an .htaccess file in the holding folder, as Drupal's .htaccess only allows index.php as a directory listing. This is all you need for the holding/.htaccess file:
# Set the default handler.
DirectoryIndex index.php index.html