Whenever I need to bring a page down quickly for maintenance I use this Apache Rewrite snippet of code to redirect everything on the server to a specific page that usually holds some kind of maintenance or error message.
The Apache Rewrite Code
RewriteEngine on
RewriteCond %{REQUEST_URI} !/theTempPage.php$
RewriteRule $ /theTempPage.php [R=307,L]
First we turn on the Rewrite engine (depending on your configuration .htaccess file it may already be on, however it won’t hurt Apache to include this if it is).
We then tell Apache to find pretty much everything after the domain name in a URL that is not equal to the maintenance page (in this case it is theTempPage.php).
If the URL is not equal to the condition, the user is forwarded to the maintenance page.


