Configuring a maintenance page for web apps using apache web server
I forgot to mention you will also require to enable rewrite module for RewriteRules to work. Use the a2enmod command to enable rewrite module.
by Mahtab Alam مهتاب
linux http server
how to allow some users to access site while for others it should show in maintenance ?
Useful info