Display maintenance site to requesters based on their IP address

Posted by user64294 on Server Fault See other posts from Server Fault or by user64294
Published on 2010-12-21T11:13:15Z Indexed on 2010/12/21 13:55 UTC
Read the original article Hit count: 329

Filed under:
|
|
|

Hi all.

I would like to set a special configuration in our apache web server. I would like to display sites to the users according to their IP addresses.

We plan to upgrade our web sites. During the upgrade we'll put a maintenance site: so all the users which will connect to our web sites will get this site.

There are 200 websites affected by the upgrade, so I don't want to change apache settings for each one.

In order to test the upgrade i need to set apache to let only my IP address to access to asked site. If my IP address is a.b.c.d and if i ask for test.com i want to see it. but all other users, having a different IP address, should get the maintenane site even if they look for test.com.

Our webserver is hosted out of the office (ovh.com france). The testers are the developers at our office and me. We can take some sites and enable them for test in which we implement IP restrictions in each website: the idea is on these websites, if the visitor's IP address is different from our office IP address we redirect this visitor to our maintenance website else we display the website.

Is there a way to do this?

Thank you.

© Server Fault or respective owner

Related posts about apache2

Related posts about ip