Forum Discussion
Irule message show
Yeah, we can make iRule to match phone browser's
User-Agent header & display message or redirect to webpage.
Example
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*iphone*" -
"*android*" -
"*windows phone*" -
"*windows ce*" -
"*bada*" -
"*bb10*" -
"*blackberry*" -
"*symbinos*" -
"*symbain os*" -
"*symbian*" -
"*java*" -
"*winowsphone*" -
"*windowsce*" {
HTTP::redirect "https://[HTTP::host]mobile.aspx"
}
default {
HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
}
- VGF5Jul 12, 2017
Cumulonimbus
if { [HTTP::uri] contains "/resignation" "/exit-interview" "/benefit-change" "/personal-info-change" "/verify-coc" "/workers-comp" "/verify-coc" "/verify-electronic-disclosure"} {
HTTP::respond 200 content {This task is not available on the mobile app. Log onto your desktop to complete this task} return }Is this correct ?
Do I need to add anything..?
- Samir_Jha_52506Jul 12, 2017
Noctilucent
Try switch condition in iRule. Example.
switch -glob [string tolower [HTTP::uri]]And add HTML syntax.
HTTP::respond 200 content { "Mobile PageSorry! This task is not available on the mobile app. Log onto your desktop to complete this task..."} - VGF5Jul 12, 2017
Cumulonimbus
Thank you f5_rock
- Samir_Jha_52506Jul 12, 2017
Noctilucent
Try switch statement to match multiple conditions.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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