Forum Discussion
Redirect Mobile with exception HTTP::uri
Hello, I need to create a irule that detects the user-agent and redirect to mobile http://mobile.xpto.br except for some uri like "/ test". If uri contain "/test" or "/abc" in the not redirect. Can someone help me?
example:
When Http_Request { if {[class match [string tolower [HTTP :: header User-Agent]] starts_with $ group_user_agent]} { if {[string tolower [HTTP :: uri]] starts_with "/ test" or [string tolower [HTTP :: uri]] starts_with "/ abc"} { pool_Site_Corporativo pool } HTTP :: redirect "http://mobile.xpto.br" } }
1 Reply
- Kevin_Stewart
Employee
The formatting was a bit off but pretty close nonetheless:
when HTTP_REQUEST { if { [class match [string tolower [HTTP :: header User-Agent]] starts_with group_user_agent] } { if { ( [string tolower [HTTP :: uri]] starts_with "/test" ) or ( [string tolower [HTTP :: uri]] starts_with "/abc" ) } { pool_Site_Corporativo pool } else { HTTP :: redirect "http://mobile.caixaseguros.com.br" } } }
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