Forum Discussion
Roger_Oliver_78
Nimbostratus
Jul 24, 2007More Custom WAP Irules
I first want to thank everyone that has done WAP before. I liked the Irules I saw and got most of them to work in my test. However I have a problem some of the newer phones do not allow multiple redir...
Colin_Walker_12
Aug 08, 2007Historic F5 Account
It looks like you're closer...let's see if I can help a little.
You're going to want only one switch per header, otherwise you're going to run into issues, especially since you're using redirects and return statements. Try condensing these a bit, like:
when HTTP_REQUEST {
switch -glob [HTTP::header User-Agent] {
"*hiptop*" -
"*AvantGo*" -
"*Danger*" {
HTTP::redirect "http://wap.vendor.com/partnergenericURL-D"
return
}
}
switch -glob [HTTP::header Accept] {
"*vnd.wap.xhtml+xml*" -
"*vnd.rim.html*" {
HTTP::redirect "http://wap.vendor.com/partnergenericURL-C"
return
}
"*vnd.wap.html*" {
HTTP::redirect "http://wap.vendor.com/partnergenericURL-B"
return
}
"*text/vnd.wap.wml*" {
HTTP::redirect "http://wap.vendor.com/partnergenericURL-A"
return
}
}
if { [matchclass [string tolower [HTTP::uri] ] starts_with $::ot_recover] > 0 } {
pool OLD_WEB_POOL
} else {
pool WEB_POOL
}
}That's a good first step in troubleshooting, anyway. If you still have problems, at least the logic will be a bit more condensed and you won't have to worry about the other switch statements not being evaluated.
HTH,
Colin
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
