YouTube and others are putting up a nice looking message page while they are doing a release or maintenance. I'm wondering what's the best way of redirecting all requests to this "Sorry we're temporarily down" page.<p>Would you modify the VirtualHost entry in Apache's httpd.conf?<p>Would you change the DNS entry?<p>Any other ideas?<p>The technique should ideally be easy to turn on and off.
Have a backup directory ready to go, and modify the DocumentRoot on your virtual host. <p>If your home page doesn't involve dynamic content (and even if it does, but you aren't touching those parts of it), keep your home page up. <p>If you aren't taking down your DB, keep the user sign-up up. <p>When someone tries to log-in, then display the message. <p>Keep your roll-out window to under 30 mins if at all possible (rolling out features in smaller batches makes this easier).
For smaller sites, I would just redirect everyone but my own IP address over to a maint.html page.<p>I wrote up how I did it with .htaccess here:
<a href="http://www.answermysearches.com/htaccess-block-everyone-except-one-ip-address/226/" rel="nofollow">http://www.answermysearches.com/htaccess-block-everyone-exce...</a>
Why do you need to take the site down to do maintenance? Even if moving physically from one server to another you should be able to migrate with almost zero downtime.