My company uses one IP address to host two web sites, let say www.domain_1.com and www.domain_2.com.
I've been analyzing two web sites and found a strange thing.
As you say, your web browser will resolve both of those addresses to the same IP address.
There will be something in your company that is listening to that IP address and serving requests. It might be a web server directly or a load balancer or something similar.
Whatever it is, it needs to accept the http connection and then read the Host: header which is sent by the web browser to decide what to do. The Host: header is simply the text between http:// and the next slash, e.g. www.domain_1.com or www.domain_2.com.
In the simplest scenario where the IP address resolves directly to a server which runs web server software, the web server software will have configuration, typically called Name Based Virtual Hosting which permits you to have separate configuration for each web site based on it reading the Host: header passed by your web browser.
It sounds as if you don't have Name Based Virtual Hosting, and are using just IP-based virtual hosting, and the web server software isn't distinguishing between the two site based on the Host: header. At least, not in general.
If you can type http://www.domain_1.com/ and http://www.domain_2.com/ and get different pages, then it's possible someone has setup some kind of Host: header check on the front page, either using the web server software configuration or in the actual web page code itself. If you immediately get a redirect to /folder_1/ or /folder_2/ respectively then that would increase the chances that this is how it is configured.
James
This message has been edited by squish on Jun 16, 2008 12:33 AM
If I type http://domain_1 I get redirect to the folder_1/folder_2 to the home page. If I replace domain_1 with domain_2 and do not change folder 's path I get the same page.
If I type http://domain_1 and domain_2 I get two distinct pages which are relative to the corresponding domains.
Ip address is the same for two domains.
I am not in charge for maintaining web server but the part of my job is to make suggestions for everything to work fine. Unless I do not understand what is happening is to hard for me to forward the issue to the right person.