I should take my time and read through the entire message -- I guess
it's rather late.
The HTTP Host information will be located in the request headers which
you can grab and put into an ns_set like this:
set headers [ns_conn headers]
You can then get the HTTP Host header with:
set host [ns_set get $headers Host]
What you're getting with [ns_conn host] is not the HTTP Host header
but rather the host portion of the URL that was requested, e.g. if the
client requested
http://scottg.net/index.adp
[ns_conn host] will return 'scottg.net'
/s.
On Nov 27, 2008, at 12:33 AM, Eric Lee wrote:
I'm trying to set up an ns_register_proc to redirect requests to
what used to be a separate website that now points to mine to a
directory on my site. (The client does not want to use a virtual
server.)
My plan is to test the host of the connection and ns_returnredirect
if it matches the formerly-separate host.
The docs at:
http://panoptic.com/wiki/aolserver/Ns_register_proc
say
"The conn argument will be filled automatically with the connection
information."
so I expected it to be an ns_set or array, but it does not seem to be.
It contains "cns0" on the first use after a server restart, then
"cns1", "cns2" on following uses.
Can someone give me a hint how to use the conn argument in:
ns_register_proc GET /* misaEast AAA BBB
proc misaEast { conn {arg1 one} {arg2 two} } {
...
}
I've also tried using [ns_conn host] within the proc but it just
returns "". Other ns_conn options, including url and location,
return the expected values. Is there a way around this?
Should what I am trying to do be done a different way?
Thank you,
Eric Lee
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]
> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.