2

I have a need to support multiple websites on a single IIS 7 server. One of these websites needs to be able to support wildcard subdomains. I was hoping to use host headers for this approach but am thinking this is not possible. The site that requires wildcard subdomains won't let me use *.site.com in the host header and therefore won't respond to subdomain requests unless i set it to listen blindly on port 80. If I have that site listen blindly on port 80, it seems my other sites will not work.

It's completely plausible I'm missing a step. Any help is greatly appreciated!

1
  • 3
    shouldn't this be on server fault? Oct 23, 2009 at 3:28

3 Answers 3

2

Give each separate website its own IP address and configure IIS to listen based on IP address rather than Host header.

Then, any single website with multiple or wildcard subdomains but at a separate IP will work with IIS listening to all incoming requests on that IP.

2
  • yup this is what i ended up doing. Oct 29, 2010 at 15:28
  • Observation: Strangely, this IP setting seems to be completely benign for me. I setup a test site with a simple text page, and it seems not matter what IP I bind it to, it always renders. Other sites, however, only refresh properly if set to "*". Makes no sense to me. :(
    – Chiramisu
    Oct 17, 2012 at 22:02
0

Just use site.com not *.site.com

0

My understanding is IIS doesnt support this. Im assuming the next best option is to use URL rewriting and set a rewrite in the global rules (not per site). I've been using IIRF with good results, and it is free. Version 2.x now has a server-level global re-write rules, then each site has its own per-site rewrite rules. I'd set something to redirect (or maybe even rewrite) *.domain.com to a fixed sub, like www.domain.com. Or even get creative and pass it as a folder like domain.com/subdomain .

Not optimal solutions, but should work.

I'm really surprised we cant get iis to do regular wildcards on hostheaders. Seems pretty basic fucntionality.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .