Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Apache virtual host based on source IP

For a certain visitor, identified by an IP, how to server contents from different DocumentRoot?

share|improve this question

marked as duplicate by Khaled, symcbean, Shane Madden, Ward, MDMarra Jan 19 '12 at 13:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer

up vote 1 down vote accepted

Changing the document root according to IP is not very efficient, and to my knowledge, not possible.

But you can include your various versions of the web site in the document root, and use mod_rewrite rules to serve the proper version according to client IP.

RewriteCond %{REMOTE_ADDR} IP
RewriteRule ^/(.*) /properroot$1
share|improve this answer
add comment

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