homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

How do I disable HTTP HOST being sent?

5+ Year Member

Msg#: 3859229 posted 3:59 pm on Feb 27, 2009 (gmt 0)

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.



WebmasterWorld Senior Member 10+ Year Member

Msg#: 3859229 posted 4:11 pm on Feb 27, 2009 (gmt 0)

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


5+ Year Member

Msg#: 3859229 posted 7:22 pm on Feb 27, 2009 (gmt 0)

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).


5+ Year Member

Msg#: 3859229 posted 8:55 pm on Feb 27, 2009 (gmt 0)

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.


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

Msg#: 3859229 posted 9:10 pm on Feb 27, 2009 (gmt 0)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved