locked
Subdomains Setup in IIS7 RRS feed

  • Question

  • User-647359487 posted

    I have a server that has a single IP address bound to it and right now, just one domain pointed to it.

    What I need to do is be able to do this....

    • app1.mydomain.com --> should be application #1
    • app2.mydomain.com --> should be application #2
    • app3.mydomain.com --> should be application #3

    I can put any of these urls into a browser and I get sent to the default IIS7 page.  We used to do this in IIS6 using Host Headers, but I can't figure out how to get this to work properly in IIS7.

    We don't want to do a redirect of app1.mydomain.com to www.mydomain.com/app1, we want application #1 to load and the url to remain app1.mydomain.com.

    All three sites are ASP.Net 3.5 web applications that actually run perfectly when we go to www.mydomain.com/app1.

    What am I missing here? We are running Windows Server 2008 and IIS 7.0.

     

    Thursday, September 11, 2008 5:25 PM

Answers

  • User1973023855 posted

    Use “Site Bindings” to specify host names for sites. In IIS Management Console select a site, then on right side under actions select Bindings…. In the Site Bindings dialog select the http binding and click Edit… here you can set the URL for that site.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, September 11, 2008 5:46 PM

All replies

  • User1973023855 posted

    Use “Site Bindings” to specify host names for sites. In IIS Management Console select a site, then on right side under actions select Bindings…. In the Site Bindings dialog select the http binding and click Edit… here you can set the URL for that site.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, September 11, 2008 5:46 PM
  • User-647359487 posted

    I must be missing something else here. 

    Thursday, September 11, 2008 11:48 PM
  • User-647359487 posted

    I think I'm close to figuring this out.  Do the subdomains need to be setup as "A Records" with my DNS host?

    What I have configured now, I think it might be working but I'm not sure, is...

    4 Websites in IIS

    1. app1.mydomain.com
    2. app2.mydomain.com
    3. app3.mydomain.com
    4. Default Web Site

    I've edited all their bindings to be:

    • Type: http
    • IP Address: All Unassigned
    • Port: 80
    • Host name: app#.mydomain.com 

    The "Default Web Site" has all the "default" settings as far as the bindings go.

    Does this sound correct to anyone out there?

    Friday, September 12, 2008 1:24 AM
  • User-1935306505 posted
    I've wondered the same thing. It would be nice if someone could give a solution.
    Sunday, November 1, 2009 12:27 PM
  • User1073881637 posted

    You can do a couple things. 

    1) create a wildcard dns mapping pointed to a single ip address to your server, then use host-headers on each website, in your case 1 IIS site for each sub-domain

    2) You can create an A record in DNS for each sub-domain pointing to an ip address hosted on your server.  Creating individual sub-domains records is more administrative overhead, but is a technical solution.

    http://support.microsoft.com/kb/190008  (although this applies to IIS 5, the concept is the same)

    Sunday, November 1, 2009 8:34 PM
  • User989702501 posted

    IIS 7 Host Header
    http://technet.microsoft.com/en-us/library/cc753195(WS.10).aspx

    You can use appcmd to configure it as well.

    Monday, November 2, 2009 1:24 AM
  • User-331012720 posted

    Hi Michael,

    I am also facing the same situation which you faced. I also want to configure few sub domains same as you wanted. Have you got the solution? If yes, can you pleae explain, how ?

    As you explain above that you have craeted 4 different websites for each URL (for aap1.mydomain.com, aap2.mydomain.com, aap3.mydomain.com & main site). I think this is not exact solution. If we apply this process then we will have to create un limited websites if our application uses several sub domains.

    Please share your solution with me.

    Thanks,

    Anuj Rathi

    Saturday, December 29, 2012 8:42 AM
  • User-331012720 posted

    Hi Bernard,

    I have set up my IIS in my local machine & also set up new website by modifying the host file situated at C:\Windows\System32\drivers\etc\.

    I have configured www.abc.com & now I want to configure few sub domains also. But I have added few entries in Site Bindings section but it doesn't work. I have added x.abc.com, y.abc.com but these urls are not accessible.

    have you any idea how can I set up sub domain in my local IIS (7.5, win 7 pro).

    Thanks,

    Anuj Rathi

    Saturday, December 29, 2012 8:50 AM
  • User989702501 posted

    define not working - error msgs, browse error ? can ping the name ?

    IIS binding needs to be unique in one of the following, host header name, port and ip. are your sub domain website correctly setup?

    First, fix the DNS or name resolution part first.. so you are using hosts file?
    each of your subdomain has an entry there? point to the same ip address of the machine? can ping the fqdn without failure?

    After that - double check the IIS site bindings, make sure no conflict and you can start all sites.

    then test again, if error - at which point and what's the error msgs?

    Tuesday, January 1, 2013 8:16 PM