Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to be able to put our site into maintenance mode, excepting certain users to allow for QA/Dev to be able to test changes to the site/database during the maintenance mode.

The problem is that the list of IPs will be changing every time we do it and do to policies, we cannot modify the main apache configuration file with a different list of IPs each time we do it. We can do a one-time modifications of the apache config in order to support reading in or using some other file that would have the exception list.

What options do I have for providing apache with a list of IPs that should not be redirected? Would an .htaccess file that we add do it? What about a file of key value pairs?

I'm looking at doing something like this in the apache config:

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/maintenance.mode -f
#RewriteCond %{REMOTE_ADDR} ## check list of exceptions??
RewriteRule !^maintenance/.*$ /maintenance/ [R,L]
share|improve this question

You can have the blacklist/whitelist in a separate file. Have a look at - it should give you enough to go on to start with.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.