« Previous Next »

Thread: IIS 6.0 host headers not working

Last post 09-04-2009 8:38 AM by PeterHaislund. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 09-02-2009, 3:31 AM

    IIS 6.0 host headers not working

    Hi,

    I has just setup a new Server 2003 x64 and was moving my websites from an old server.
    On my new server IIS doesn't seem to detect the host headers I have set on the websites. All calls go to the default website for some reason.

    I have 2 sites:

    Name:                      Header
    Default site               
    sub.mydomain.com    sub.mydomain.com

    So when I open sub.mydomain.com in my browser it just goes to the default site??

    All dns entries should be set ok (I use one.com as dns server), so how do I debug this?
    How can I see if the dns server is removing the headers or what is going on?

    Thanks,

    Peter

  • 09-02-2009, 9:06 AM In reply to

    Re: IIS 6.0 host headers not working

    PeterHaislund:
    How can I see if the dns server is removing the headers or what is going on?

    DNS doesn't affect the headers.  Especially if it hasn't changed.

    You need to use headers on all sites.  You need to make sure the home directory poiints to different folders for each.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 09-02-2009, 9:23 AM In reply to

    Re: IIS 6.0 host headers not working

    Why do I need to use headers for all sites? That doesn't make sense to me - a default site is very usefull. (Nevertheless; Even if I have headers for all sites, it still doesn't work - that is why I suspect something going on benieth the "engine")

     I have tried this:

    - Setting header on the default site (so no default exists) to www.mydomain.com

    Then nothing works; both www.mydomain.com and sub.mydomain.com return "The webpage cannot be found".

    - Setting 127.0.0.1 sub.mydomain.com in host file

    Then it works from the server, but not from the internet (goes to default site).

    To me it looks like IIS can't see any headers and return the default site always, but if the entry in in the local host file and the call comes locally from the server, then everything works! 

    And of course the home directory points to different folders.

    - Peter

  • 09-04-2009, 8:03 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,216
    • IIS MVPs

    Re: IIS 6.0 host headers not working

    PeterHaislund:
    Why do I need to use headers for all sites? That doesn't make sense to me - a default site is very usefull.

    I think you're misunderstanding the "default" site - it's simply the first site that gets setup during install, by default.  I do not believe MS ever intended it to mean that it's the site that gets served by default when it doesn't know what else to serve.

    In my experience, once you start using host headers on any site, every site should be set with a host header.

    Anyway, I've never heard of IIS having trouble with this so I suspect it's a networking issue.  What happens if you ping both names from a remote client?  What's the exact/full error message when nothing works?  Does anything get logged by IIS when this happens?

  • 09-04-2009, 8:38 AM In reply to

    Re: IIS 6.0 host headers not working

    Well I always found the default site usefull in this way - but that is not the issue here.

    I have never had these problems before as well, so I have no idea where to start looking.

    If I ping both domains I get the same ips.

    When I open sub.mydomain.com the it is logged in the log for the other (default) site. So it would be nice to see what the exact request was - the log only writes /default.htm etc; not sub.mydomain.com/default.htm.

    But no errors elsewhere - it just goes to the wrong site.

     /Peter

Page 1 of 1 (5 items)
Microsoft Communities