Forum Discussion
Kai_Wilke
Feb 02, 2016MVP
Hi Cames1,
your [switch -glob] code looks good and the HOST test.domain.com should normaly match the *.domain.com condition. Chaning to [switch -regexp] is not required for this simple condition, it would just put some heavy CPU load on your device. The performance impact of [switch -regexp] is realy impressive and should be avoided if possible...
My bet is, that you've saved and tested the iRule without opening and closing your browser (aka. establishing new TCP connections). Keep in mind that any changes to iRules would just affect any new TCP connections.
To see whats going on behind the scenes, you may also want to add some [log] statements...
log -noname local0.debug "Before switch: [string tolower [HTTP::host]]"
switch -glob -- [string tolower [HTTP::host]] {
"*.domain.com" {
log -noname local0.debug "*.domain.com switch!"
Do Something
}
default {
log -noname local0.debug "default switch!"
Do Something
}
}
Cheers, Kai