On Mon, 29 Apr 2002, Antony Stone wrote: > > How does the HTTP redirect to another box work if both domains are > > pointing to the same address? > > Suppose abc.com and xyz.com both point to a web server on 11.22.33.44 > > The webserver on 11.22.33.44 gets a request for abc.com and responds with a > redirect to 22.33.44.55 (where the server will presumably pretend to be > abc.com), alternatively if the webserver on 11.22.33.44 gets a request for > xyz.com it responds with a redirect to 33.44.55.66 > > Is this helpful ? > Hmm... a redirect sends the Location: http://new-url... header as reply and this will result in a new request from the user and will change the URL displayed.
In your case this will show http://33.44.55.66 instead of http://xyz.com after the redirect was sent from 11.33.44.55.66. If this is what you were looking for, changin the DNS record is a better solution. If you want to hide your two machines behind one address for multiple virtual domains, you can't do this with sending back a redirect to the user. Assume xyz.com, abc.com is hosted on a NT (the 22...) box and foo.com and bar.com is hosted on a Linux box (33...) and you want a common DNS setup for all those domains. In this case all four domains have the 11... address. If the user requests xyz.com and the apache for the 11. redirects to 22., how does the NT box decide if it is xyz.com or abc.com without having the domain within the URL string? Maybe I forgot or misunderstand something here but I don't know about some kind of HTTP redirect that will keep the request string and just let the useragent connect to a new address for the same url requested? -- Marcus
