IIS 6: Bad Request (Invalid Hostname)

10,693

Solution 1

Well, I re-imaged my VPS, and started my setup process again. I was more cautious to watch for when things went awry. Turns out, it was my PHP installation. Doh!

Thanks for the help, thought I would close this out.

Solution 2

IIS gives that error when it cannot find a web site in its settings configured with the IP address and hostname combination you used to connect. It's possible that the web site was configured with a specific IP and hostname, but the hostname you're using to connect is different (i.e. example.com vs. www.example.com). If the web site has a dedicated IP address on the server you can edit the configuration to use the IP only without a specific hostname and it will answer any requests on that IP. If the IP is shared you will need to configure all of the hostnames that can be used to access the site.

Share:
10,693

Related videos on Youtube

Roi Ronn
Author by

Roi Ronn

Web Application Developer at NASA, trying to bring some C# and ASP.NET love to the space program....as well as some post-1995 web design techniques

Updated on September 17, 2022

Comments

  • Roi Ronn
    Roi Ronn almost 2 years

    I've set up a site within IIS with default settings. I consitently get "Bad Request (Invalid Hostname). I get it from a client, or even while browsing from IE on the server.

    Can anyone point me in the right direction?

    Thanks

  • Roi Ronn
    Roi Ronn over 14 years
    I followed these instructions here: visualwin.com/host-header Everything seems right, and I know my domain is pointed to the appropriate IP address (at least the ping brings up the right IP in my command prompt). Not sure what "dual-homed" means. I am on a Windows VPS, but I don't think that should make any difference. Oh, and of course I have a dedicated IP address to my VPS.
  • joeqwerty
    joeqwerty over 14 years
    So you're saying that you did set up host headers on the web site? If so, are you typing the value of the hostheader in your browser when trying to access the site? If not, that would explain the Bad Request error. When using host headers the web site will only respond with the default page to browsers that pass the matching host header string. So if my host header is www.domain.com and I type servername or ipaddress in my browser I'll get the Bad Request error message.