Search code examples
iiswebserversubdomainmultiple-domains

Multiple websites on one IIS server


So if I have two domains i.e. domain1.example and domain2.example, both pointing to the exact same IP address (i.e. 192.0.2.1) on port 80.

How do I take users from domain1.example to one site, and users requesting from domain2.example to another site?

Additionally how do I set up subdomains? Someone requesting x.domain1.example should go to a third site.


Solution

  • When you configure the site in IIS you can assign the necessary host name in the bindings and the site will only respond to this.

    enter image description here