Skip to main content
Known Participant
December 12, 2009
Question

CFHTTP problem with Host Headers

  • December 12, 2009
  • 2 replies
  • 3720 views

I am trying to post a form on a windows server using cfhttp.

The website relies on host headers to work properly (there are many sites on the server), but cfhttp posts appear not to send the required header information, returning a "No websites are configured" error message.

I've tried sending header info with <cfhttpparam type="header" name="host" value="www.mydomain.tld"> and it hasn't worked.

It may be important to know that the domain name is local only and relies on an entry in the hosts file, both on the browser machine and the server machine.

I have recently reconfigured the web server.  Previously, each site had its own IP address, but now they are all the same and using host headers.  Before, when each site had a unique IP, the cfhttp posts worked fine.

Is there a way to get them working in the host header configuration?

Thanks for replies.

- Don

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
December 25, 2009
I've tried sending header info with <cfhttpparam type="header" name="host" value="www.mydomain.tld"> and it hasn't worked.

Does this fare any better?

<cfhttpparam type="header" name="host" value="mydomain.tld">

January 12, 2010

Thanks for the reply.  Unfortunately, it doesn't seem to make any difference.

Any other ideas?

BKBK
Community Expert
Community Expert
January 12, 2010

Does IP address work as the value?

Inspiring
December 24, 2009

But hang on... host headers are a web server conceit, are they not?  The client agent (ie: <cfhttp> in this case) just sends an HTTP request to a domain name.  It's up to the web server to untangle which domain name goes to which website within its config.  All <cfhttp> needs to send is an HTTP to request to a valid domain, just like if I was typing in a URL in my web browser... the web browser doesn't need anything other than the domain name to reach the web server (assuming the domain name can be resolved into an IP address and get routed correctly, obviously).

?

--

Adam