Drupal multisite configuration with a single database and redirection based on IP I need to implement multi site configuration in Drupal 7. I have a Drupal code base called example.com and two subdomains sub1.example.com and sub2.example.com in sites/ folder. I am using a shared database also. My requirement is to to redirect a user to sub1.example.com if the user enters the url http://example.com from country1. When any other user hits the same url http://example.com from country2 then he must be redirected to sub2.example.com. The user must be unaware of the country specific domain redirection.

I am using drupal 7.7. I installed ip2locale module for redirecting the users based on their IP and a domain access module also is installed.


  Is the domain access module really needed for meeting my requirement ?


If I have to use domain access module


  do I need to set up virtual host separately for each sub domain when
  domain access module is used? Is ip2locale module alone sufficient for
  redirection based on IP?
If you are using IP2Local and purely redirecting to completely independent url that has a directly associated database (users, content, configurations) you don't really need domain access. You could keep all the data in the same database (save time on table maintenance) and separate them with prefix's.

You will need domain access if you are centrally sharing content, users and admin tasks as well as the database but need to open or restrict access based on the domain that the user is accessing through. If your users need to cross from site1 to site2 or access common content, this would be the way to go. Domain gives you more flexibility and scalability that option 1 but may require a little more work to set up.