Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

How do I disable HTTP HOST being sent?



3:59 pm on Feb 27, 2009 (gmt 0)

10+ Year Member

Hey all :)

I need to try and replicate an error on a site, but I'm not sure how to do it.

When "HTTP_HOST" is not set (which comes from the browser IIRC) the site errors.

How can I test this? I need to disable this HTTP_HOST value being sent but can't see where I can do this in IE/Firefox etc.


4:11 pm on Feb 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi Karma. This post may be helpful to you:
HTTP_HOST vs SERVER_NAME [webmasterworld.com]


7:22 pm on Feb 27, 2009 (gmt 0)

10+ Year Member

Thanks physics, didn't really help though.

I'm trying to find a way of stopping the HTTP_HOST being sent by the browser.

I'm slightly suspicious that someone/something is sending these requests at my server with malicious intent (either way, I need to amend the code to cope with it being empty).


8:55 pm on Feb 27, 2009 (gmt 0)

5+ Year Member

You can make FF/IE not send the HTTP Host: header by using the IP address of your website. Other options are to use either a program meant to do that sort of thing (e.g., a perl script), or do it manually.

For the manual process, do something like fire up Hyperterminal, connect to your-site.example.com, port 80, turn on local echo (so you can see what you're doing), and type in the HTTP request. e.g.,

GET / HTTP/1.0<return>

GET /your/page.html HTTP/1.0<return>
Host: happy.days.are.here.again<return>

You'll then get to see the entire response from your webserver, headers and all.


9:10 pm on Feb 27, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

you can filter http request headers with the Modify Headers 0.6.1 [modifyheaders.mozdev.org] add-on for firefox.

Featured Threads

Hot Threads This Week

Hot Threads This Month