That's the problem. Apache looks at %HTTP_HOST and it is always the static IP address. %HTTP_REFERER holds the web site name requested. e.g. www.example1.com and I want a way to move the contents of %HTTP_REFERER into %HTTP_HOST before the virtual host is assigned by Apache so that it goes to the right site. Sorry if I am not being clear.