Link to home
Start Free TrialLog in
Avatar of websss
websssFlag for Kenya

asked on

IIS7 - Wildcard - Accepting any subdomain for website binding: i.e. *.domain.com

I have a win 2008 R2 server with IIS7
It has a dedicated IP address
It hosts multiple sites
One of the sites is a software product, it hosts multiple bindings for completely different top level domains (people have their own domain on our software)

However, for a free demo, we are creating the ability to have their own sub domain under our domain
It will look like:
TheirCompanyName.OurDomain.com

i.e. AcmeBuilders.OurDomain.com

I have set up the domain name to forward any subdomain at the IP address, this is working fine ( * A RECORD )
However, I now need to configure IIS to accept anything.OurDomain.com

Its called a wildcard IIS Binding I think
I've read a few articles that say it might be possible as I have a dedicated IP

However, what i'm unsure about is: I also need to host lots of other top level domain names
....if the customer signs up for trial on
AcmeBuilders.OurDomain.com

If he goes ahead with our product he will use his own domain
App.AcmeBuilders.com

So in summary, how to i a set up iis to allow wild card subdomains... *.OurDomain.com whilst retaining support for any other domains
Avatar of dgrafx
dgrafx
Flag of United States of America image

You probably have an A record that points to your IP address with a blank Host Name and also maybe an A record for the www Host Name pointing to the same IP address.
All you need do is create another A record and use * as Host Name and point to the same IP address.

Good luck ...
Avatar of websss

ASKER

Thanks
The domain part is already done and working
Its setting up iis that I was asking about
Will the subdomain remain in place as the client browses their site?  Or do you just want to capture the hostname portion of the FQDN and redirect them down into a client named URL?

So, all requests appear in the browser address bar as:

1. client.yourdomain.com/{REQUESTED_URI}  and the hostname of the request remains.

- or -

2.  client.yourdomain.com/{REQUESTED_URI} but redirects to www.yourdomain.com/CLIENT-NAME/{REQUESTED_URI}?

As for maintaining the other sites on your dedicated IP... You must use "Host Names" for all of the other site bindings.

On the demo site, use the "All unassigned" binding for the IP and port, with no host name.  This creates a catch all site.  If there is no IP + Host Name match on a binding, IIS will allow the request to drop down to the * binding.

Similar to when hosting multiple websites on IIS, a provider can display a last effort HTTP error page in case the client hasn't defined error pages in their site config.

Dan
Ah sorry - wasn't paying attention I guess ...

So in that case I don't do anything different on IIS - I use the web language to control what is done when a user comes in on a subdomain.
For example different content might be pulled from the DB based on the subdomain.
Anyway ...
Avatar of websss

ASKER

>Will the subdomain remain in place as the client browses their site?

Yes,  the whole session will be on exactly same domain,  so number 1

>use the "All unassigned" binding for the IP and port, with no host name.  This creates a catch all site.

So I should remove all existing bindings, then use *,  so anything hitting this IP that isn't intercepted by the other iis websites with their specific bindings will goto this website... Kinda like a default website for server?
ASKER CERTIFIED SOLUTION
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of websss

ASKER

That worked thanks!