I think I can get the answer faster from this helpful and generous group
of people then I can write one line of code and try it out on a wide
variety of environments.
What exactly is cgi.server_name expected to return? Looking at the
following examples what would you expect to be in this
http://134.139.143.25/stompy/server.cfm
or
http://cfdev.cota.csulb.edu/stompy/server.cfm
both return:
CGI.SERVER_NAME: cfdev.cota.csulb.edu
It looks like it returns the name registered in the web server (apache,
in my case). The above addresses both go to the same server.
Mike
Ian
CGI var that I can't remember] and you'll come across a post or two that
explains what it returns.
Or not :OD
Adrian
-Original Message-
From: Ian Skinner [mailto:h...@ilsweb.com]
Sent: 12 March 2009 17:20
To: cf-talk
Subject: What *exactly* does cgi.server_name return.
I think
Adrian Lynch wrote:
calpip-devsite/index.cfm calpip-devsite
calpip.cdpr.ca.gov/index.cfm calpip.cdpr.ca.gov
calpip-devsite.inisde.cdpr.ca.gov/index.cfm
calpip-devsite.inisde.cdpr.ca.gov
10.104.106.113/index.cfm
I thought I'd add to this:
http://134.139.143.25/stompy/server.cfm
http://cfdev.cota.csulb.edu/stompy/server.cfm
http://servername/stompy/server.cfm
http://servername.ad.dns.entry/stompy/server.cfm
http://localhost/stompy/server.cfm
all return:
CGI.SERVER_NAME: cfdev.cota.csulb.edu
I do have
Ian Skinner wrote:
I think I can get the answer faster from this helpful and generous group
of people then I can write one line of code and try it out on a wide
variety of environments.
It depends on the web server. IIS should return whatever is in the
domain part of the URL the user used
What exactly is cgi.server_name expected to return?
The thing about CGI variables is that these expectations can be pretty
vague. CF doesn't control them; they're controlled by the web server
and/or the operating system. I would generally expect it to return the
server hostname, IP address or
Since IIS uses the DNS alias in the URL and that can easily be spoof by
modifying your HOSTS file, I use a Java class if I need to identify a
machine (like for environmental changes).
InetAddress = createObject(java, java.net.InetAddress);
hostName = InetAddress.getLocalHost().getHostName();
At
8 matches
Mail list logo