[http::host] inside "when rule_init"
Hi,
I am very new to this irule scripting, frankly saying first time i am using. I am planning to use the below code snippet for redirecting urls
when RULE_INIT
{
switch -glob [string tolower [HTTP::host]]
{
"*xxx*"
{
set static::external "xxx.abc.com"
set static::internal "xxx.internet.abc.com"
}
"*yyy*"
{
set static::external "yyy.abc.com"
set static::internal "yyy.internet.abc.com"
}
"*zzz*"
{
set static::external "zzz.abc.com"
set static::internal "zzz.internet.abc.com"
}
}
}
based on the external and internal value there is some other logic involved in "when HTTP_REQUEST" and "when HTTP_RESPONSE", my doubt is will [HTTP::host] get the value inside "when RULE_INIT". will the above snippet works? if not what is the solution for that?
Thanks in advance
Ganesh.