, Johann Schmitz

Here is a nice way to show a maintenance page to some user based on the presence of a cookie. This can be useful if you want to temporarily show a maintenance page to the majority of users and you cannot use ip based restrictions:

RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*i-will-fix-it.*$ [NC]
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule .* /maintenance.html [NC,L]

Now place a maintenance.html into your DocumentRoot, reload apache and the site in the browser. The content of the maintenance.html should pop up.

Now use Firebug/Chrome Developer Tools/whatever to create a new Cookie name i-will-fix-it (value doesn't matter) for the domain and refresh the page.