Rewrite url based on IP



I am trying to rewrite a url and dont have an idea how this can be achieved.

current setup

  1. client hits a url
  2. this goes to the apache backend virtual host

What I want is

  1. client hits a url
  2. based on his IP we forward to different virtual hosts
  3. E.g
    client ip this gets fowarded to virtual host
    client ip this gets forded to virtual host


I have manged to resolve this by using src to differentiate ip and reqirep to rewrite the host