IIS 7 and Above
HTTP Error 400. The request hostname is invalid
Last post Sep 27, 2011 02:26 AM by andyguevara
Jun 06, 2010 12:50 PM|blaine.miller|LINK
All I'm trying to do is create a simple website. To begin with. Nothing fancy, so all the fancy stuff I'll leave toll later. I've gone through three different versions of "setting up a simple website. None of them have worked for me. I am looking for an
even simpler, step by step guide with examples on how to set up a simple, stupid website.
And I thought Apache was supposed to be complicated! When I use the default site, I get the splash page no problem. When I try to serve my contect on a "new site" with the same IP and turn off the default website, I get the subject line error.
I've been working on getting this danged thing set up for almost a month now. I'd appreciate any help you can offer in a simple, step by step mode. I don't need fancy, like I said. Nor a smart aleck. Just someone who's willing to hold my hand through the
The frustration level here is intense.
Jun 06, 2010 01:21 PM|Rovastar|LINK
To start with what version of Windows do you have and what technologies do you use to create your website (asp, asp.net, phph, html, etc).
For simple stuff why not edit the Default website and add your files to that location.
Files will need to have NTFS persmissions like those for the files for the default web site.
Jun 06, 2010 01:53 PM|blaine.miller|LINK
I'm using Windows 2008 R2, IIS 7.5 and HTML.I tried using the default website and just editing that installation and got a different error, but still no website.
The error I got eludes me at this moment, but I can recreate it in a few sec.s.
I'll check file permissions, but nowhere in the various setup guides do I remember seeing file permissions as an issue.
Thanks for your time and patience.
Jun 06, 2010 01:59 PM|blaine.miller|LINK
I just shared the directory where the content is stored. The folder and files appear to be rwx, or the equivalent in Windows.
Is there anything else I should look to as far as file permissions? Sorry, I'm not used to the Windows nomentclature.
Jun 06, 2010 05:17 PM|Rovastar|LINK
Reading up on the 400 request hostname is invalid. It could be well be an issue with your browser/client setup. It isn not acommon error.
It could be your IIS setup.
So what do you enter in your browser to get this?
Are you conneccting via teh IP address. like http://220.127.116.11 or via a domain name like http://www.mysite.com
BUt there are a few things you can try.
To get more information on this 400 error you will need to look at the http.sys log file. look under here for the relevany fiel and post here.
Jun 06, 2010 08:01 PM|blaine.miller|LINK
Thanks for the info. Here are the contents of my httperr1 file:
#Software: Microsoft HTTP API 2.0
#Date: 2010-05-30 15:23:52
#Fields: date time c-ip c-port s-ip s-port cs-version cs-method cs-uri sc-status s-siteid s-reason s-queuename
2010-05-30 15:23:52 18.104.22.168 29980 22.214.171.124 80 - - - 400 - Verb -
2010-05-30 16:56:42 126.96.36.199 54970 188.8.131.52 80 - - - - - Timer_ConnectionIdle -
2010-06-01 04:49:48 184.108.40.206 23708 220.127.116.11 80 - - - - - Timer_ConnectionIdle -
2010-06-03 00:45:25 18.104.22.168 1338 22.214.171.124 80 HTTP/1.0 CONNECT smtp.citiz.net:25 400 - URL -
2010-06-06 03:06:05 ::1%0 49217 ::1%0 80 - - - - - Timer_ConnectionIdle -
2010-06-06 04:07:59 126.96.36.199 55866 188.8.131.52 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 04:08:06 184.108.40.206 55867 220.127.116.11 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:08:51 18.104.22.168 49390 22.214.171.124 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:34:16 126.96.36.199 49479 188.8.131.52 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:34:17 184.108.40.206 49481 220.127.116.11 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:34:19 18.104.22.168 49482 22.214.171.124 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:37:20 126.96.36.199 49530 188.8.131.52 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:37:22 184.108.40.206 49531 220.127.116.11 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 16:57:56 18.104.22.168 28969 22.214.171.124 80 HTTP/1.0 GET /robots.txt 400 - Hostname -
2010-06-06 16:57:56 126.96.36.199 28971 188.8.131.52 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 17:57:01 184.108.40.206 49899 220.127.116.11 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 17:57:03 18.104.22.168 49901 22.214.171.124 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 18:00:35 126.96.36.199 49959 188.8.131.52 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 18:26:50 184.108.40.206 58749 220.127.116.11 80 HTTP/1.1 GET /Education_Degrees.cfm?fp=%2FE7Jg3%2BSQhe0N6YSCn5RkRII4IpnCsa0mTNqd0xq7o4lzYbiibwNcpJ9x%2F6wZzUtnOA69zK7SrY4xSJnvAZc1hxnegtJoQE8rO8MLrXwUOib0dcMwxy3obVevUAaZ1kUNjGh1GNAZc3GUcmGshZUnzR6qagQdJvjvVJA7OSWTRY%3D&&kt=4&kp=11
400 - Hostname -
2010-06-06 20:38:20 18.104.22.168 62096 22.214.171.124 80 HTTP/1.0 GET /robots.txt 400 - Hostname -
2010-06-06 20:38:20 126.96.36.199 62100 188.8.131.52 80 HTTP/1.1 GET / 400 - Hostname -
2010-06-06 21:36:37 184.108.40.206 21186 220.127.116.11 80 HTTP/1.1 GET / 400 - Hostname -
None of this makes much sense to me, unfortunately.
I try to access the hostname by either the IP or FQDN, 18.104.22.168 & silentpartnerstech.com.
Thanks for your time and patient consideration.
Jun 07, 2010 07:44 AM|Rovastar|LINK
Does http://localhost work from the server itself?
I am a little confused as I can browse to http://silentpartnerstech.com and the IP as it then goes to the default website.
So traffic is getting through. You have the default website setup to receive requests for that hostname and IP and it appears that this site is still active. I thought you said you disabled this site?
Why not put all your files under this fiel location of this default site, as it is active, and try to connect to connect direct to the pages from tehre.
e.g. if you have a fiel mypage.html in teh root can you connect to silentparterstech.com/mypage.html
Jun 07, 2010 08:26 AM|blaine.miller|LINK
When I was working on this, I left the good, default webpage started and stopped the broken site.
I've reset it so that the default is off and the new silentpartnerstech.com page is started and active.
As you can see, it's still broken.
Thanks for you time and bearing with me.
Jun 07, 2010 09:16 AM|Rovastar|LINK
Ok. Then there seems to be something in your configuartion of the site you setup.
The easist way might be to place your applciation/site under the default website liek I sugegsted before.
So stop the current one. Place you code under where the folder/directory of the default site and try and browser directly to a page.
Jun 07, 2010 10:41 AM|blaine.miller|LINK
I don't understand what is meant by something is wrong with my configuration and yes, I'll try to do as you say and put my "new website" under the default directory & see what happens.
Thanks for the suggestions!
Jun 07, 2010 11:15 AM|Rovastar|LINK
What I meant is that the default site settings seem to serve pages correctly. So let's, for teh moment at least, use this structure if possible.
Jun 07, 2010 11:46 AM|blaine.miller|LINK
And we have a (sort of) web page! Thanks! The index.html page is being served! Great!
Next I would like to figure out why the page can't be served from the new site. I actually plan to serve several sites fromthe single IP I have. In Apache this is done with a virtually hosting arrangement. How is it done in IIS 7.5?
Thanks again for your patience and time.
Jul 25, 2011 09:00 AM|tekkerguy|LINK
I know this is an old post but for me, the problem was in the binding settings, I gave it a host name. When I removed the host name, and went to localhost:port number, it worked
Jul 25, 2011 09:26 AM|HCamper|LINK
Yep it's old and missing some information.
http://www.it-notebook.org/iis/article/understanding_host_headers.htm describes how Host Headers operate.
http://www.it-notebook.org/iis/article/hosts_file_host_headers.htm shows the Hosts file
and how to use IP Address and Host Name together.
Common problem with Vista Windows 7 which use IPV6 you may find
entry in the Hosts file ::1 which is the IPV6 IP Address for localhost.
If you edit the Hosts file and comment out the IPV6 locahost ::1 your problems may be resolved.
Sep 27, 2011 02:26 AM|andyguevara|LINK