Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

migrated from stackoverflow.com Oct 5 '10 at 22:37

This question came from our site for professional and enthusiast programmers.

3  
shouldn't this be on server fault? –  Keith Nicholas Oct 23 '09 at 3:28

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
yup this is what i ended up doing. –  Keith Fitzgerald Oct 29 '10 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 '12 at 22:02

Just use site.com not *.site.com

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.