Hey guys,
I created a pretty basic/lame redirect rule and I thought I’d post it to see if anyone had any recommendations on how to optimize it. I’ll paste the goods first since I think it basically speaks for itself, then explain why I’m hoping to optimize:
when HTTP_REQUEST {
switch -glob [HTTP::host] {
"*domain.ca" {
log local0. "Detected domain.ca URL"
HTTP::redirect "http://domain.myasp.com[HTTP::uri]"
}
"*domain.com" {
log local0. "Detected domain.com URL"
HTTP::redirect "http://domain.myasp.com[HTTP::uri]"
}
default {
log local0. "Using default pool"
use pool http-pool-myasp
}
}
}
This list could get a bit longer, and it could be used across multiple VSs (HTTP & HTTPS). I guess what I’m wondering is if this is a good way to go or if perhaps there is a more efficient way to put this together?
As it stands now I am having to create a different iRule for each “set” of domains. I believe I could use a data group to simplify the rule but I am not sure how that would look nor if there would be performance implications of settings up several (dozens?) of mappings within one data group and applying this single iRule to all VSs. I am also not sure how the wildcard would play into this when combined with data groups. Please keep in mind I have extremely novice programming experience but can usually walk my way through a rule.
Cheers, and thanks!
Chris