Forum Discussion
hooleylist
Jul 12, 2010Cirrostratus
A small note:
[HTTP::host] - will return the host header value
[HTTP::host] eq "dns.domain.com" - will return 0 or 1 depending on whether the HTTP host is dns.domain.com or not
[[HTTP::host] eq "dns.domain.com"] - will try to execute 0 or 1 and return a runtime TCL error as 0 or 1 isn't a valid command
Similarly:
[HTTP::uri] - will return the URI (path plus query string)
[HTTP::uri] eq "/" - will return 0 or 1 depending on whether the HTTP URI is / or not
[[HTTP::uri] eq "/"]] - will try to execute 0 or 1 and return a runtime TCL error as 0 or 1 isn't a valid command
You could use this:
if { [string tolower [HTTP::host]] eq "dns.domain.com" and [HTTP::uri] eq "/"] } {
Or use Joe's preferred syntax:
if { [string tolower [HTTP::host]][HTTP::uri] eq "dns.domain.com/" } {
Aaron