We have a legacy web app running from foo.com and a new version running on demo.bar.com both from a single apache server.
The httpd-vhosts.conf file looks like this:
<VirtualHost *:80>
DocumentRoot /dir1
ServerName foo.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /dir2
ServerName demo.bar.com
</VirtualHost>
Currently we semi-automatically migrate apps from demo URLs to the production URLs - copying over directories, changing config files etc...
This can be easy sometimes, other times not - depending on the app complexity.
Is it possible to instruct the apache web server to internally redirect traffic from foo.com to demo.bar.com where the client does not see demo.bar.com and demo.bar.com does not see the behind the scenes redirect?
If possible, are there any implications regarding cookies, basic access authentication etc.?