Forum Moderators: open
I don't understand shared IP hosting completely. I know that you can put multiple domains on a single host computer (I've read a little about Apache servers), and that a domain name request will be routed to the correct (subdirectory???) on that server. But I thought that entailed multiple IP's for that single computer.
For example, if I know my domain is at 1.2.3.4, then shouldn't any request for [1.2.3.4...] pull that web page? If the domain is shared, how would the server know which page to fetch?
Or am I confused by the phrase 'shared IP'?
TIA
When the host is specified as the URL then it just matches the host name against entries in it's list, if it is not found it return a 404, if it is found it retrieves the content from the path specified for that host.
Connect to 255.255.255.255 80
GET /filename HTTP/1.1
Host: www.domain.com
The first line is the IP address to connect to and the port number. The next line is the request for the file and the protocol version. The third line tells it which host on that IP address to request from. When the web server sees the "Host" line, it then directs the request to the correct domain on that IP address. You can have an infinite number of domains hosted on a single IP address.
However, if one wished to point one domain at the root index page of the IP and then point other domains at the index pages of other folders located in that IP's root directory, could this also be achieved?
-Canton
Yup, you would just define each domain as a separate name based virtual host, and point the "DocumentRoot" for each domain to the folder that contains the index page for that domain.