Putting a site under maintenance

Pascal Specht asks a good question in the eZ Publish forums: how to put a site under maintenance without breaking bookmarks and external links ?

The easiest way (the only ?) is probably to use mod_rewrite of Apache to distribute a maintenance page instead of the normal page. This can be done with those few lines in a .htaccess file :

RewriteEngine on
#  RewriteCond  %{REMOTE_ADDR}         !^82.225.188.34$
RewriteRule  (.*) /path/to/your/maintenance/file/index.htm [L]

With this setting, Apache distributes the index.htm file for all request. You can also put your own IP address on the second line and uncomment it so that you can view the normal site for example to generate some caches in eZ Publish before putting your site online again.