Cutting the fluff: Wildcard Host Header Support, is that possible in some way in IIS 8 for subdomains?
I know, it's a bad design which is why I keep the original question below to explain why...
I have two domains, example1.com and example2.com and I want both of them hosted on a simple server running Windows 2012 with IIS 8. I also have just one IP address and things are a bit challenging. However, this is not a production environment but a test environment for me to test complete website projects before they're delivered to a production environment. Then it's done and I start a new project with a new domain.
So I've set up one site in IIS and any incoming traffic goes to that site.I have a second site set up with binding for the second domain and that generally works fine when dealing with many different domains. But now I have a challenge.
I am now working on two projects that both heavily rely on the use of subdomains for the users. So for every user on the site there has to be a specific subdomain. Customer wants this so don't tell me it's a bad idea. Customer is demanding. (And horribly enough, I'm now working on two sites that need this. One would be easy.) So both sites now need to accept all subdomains for a specific domain name. So while most would go to example1.com the url wim.example2.com should go to the second website. And while that would be easy with a second IP address, I just have one.
So how do I get all subdomains go to the right site in IIS 8?
I found https://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-it-possible-to-make-them-like-it-is-in-apache which seems to answer my question so I will close this one. IIS 7 and IIS 8 don't support wildcard bindings for a single domain name as you need to upgrade to IIS 10 for this feature. And IIS 10 requires Windows 2016 (or Windows 10) so without an upgrade of the operating system this will not be possible.
But an option could be https://www.microsoft.com/en-us/download/details.aspx?id=48264, which is a simplified version of IIS 10 which can run on Windows 2012 so that's something to consider. And as my environment is for development, this is a good option for me. Not practical for production servers, though...