Originally HTTP was designed with the assumption that every domain has its own IP address.
Meaning if you want to host multiple websites on a single machine, you needed to give that machine multiple IP addresses (or you can workaround by putting one of them on a different port, but this was not common for user-facing websites, as you’d have to put the port in the URL like this: http://example.com:9731 ).
In HTTP/1.1 they made it mandatory for clients to send a “Host:” header with the domain you’re asking for. This solves the problem and lets you run multiple websites, as the web server can see “Host: www.example.com” and do something different than “Host: www.myothersite.com”
HTTP/1.1 was released in 1997, so at this point every HTTP client has supported it for decades.
Latest Answers