Forum Discussion
Jim_Gray_43725
Feb 08, 2012Nimbostratus
http redirect based on path and query strings
I have a data group with 166 lines of source and target URLs for redirect. Most source URLs include 1 to 3 different queries. I need to find a way to match an incoming path and each query in any orde...
hooleylist
Mar 06, 2013Cirrostratus
Hi Ashish,
Make sure to set the string you're comparing to lowercase (iPhone -> iphone). Also remove the * from the string as contains logically checks for *iphone* in the example below.
when HTTP_REQUEST {
if { [string tolower [HTTP::header "User-Agent"]] contains "iphone" } {
HTTP::redirect "https://lite.example.co.in"
}
}
Here are a couple of posts where we discussed options for mobile client redirects (particularly the iRule in the second example):
https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/86313/showtab/groupforums/Default.aspx86381
https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2160890/showtab/groupforums/Default.aspx2236593
Aaron
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