in reply to Re^3: Get data via HTTP on IP and specify virtual host
in thread Get data via HTTP on IP and specify virtual host

But the server side still needs to have some sort of config (e.g. the httpd.conf file) to process the "host" name in the header and point it to the right vhost. It doesn't need to be in the /etc/hosts, but there has to be some sort of incoming route handling.
  • Comment on Re^4: Get data via HTTP on IP and specify virtual host

Replies are listed 'Best First'.
Re^5: Get data via HTTP on IP and specify virtual host
by Corion (Patriarch) on Feb 29, 2012 at 09:08 UTC

    /etc/hosts (or DNS) does not come into play at all. Again, see RFC 2616 for how a webserver can determine which host ("website") was meant by the client.

    As the original post mentions in the title "virtual host", I would assume that the web server already is configured to serve multiple websites under the same IP address (and port).