Forum Discussion
https to https redirect based on user-agent
I have the following irule setup and working in my infrastructure. Recently we added a feature on my website that requires me to make this same redirect work for SSL traffic. We also do SSL offload to our backend if that's relevant. In this case what I need to do is: 1) decrypt on the F5 -> look at the user-agent -> if mobile send a redirect -> if non-mobile go to pool.
Does anyone have a sample or an idea of how to make this work correctly?
when HTTP_REQUEST { if {[HTTP::cookie exists "MobileOptOut"]}{ return } elseif {[class match [string tolower [HTTP::uri]] contains ImageList]} { return } elseif { [string tolower [HTTP::uri]] starts_with "/mobile" } { HTTP::redirect http://m.site.com } elseif {[class match [string tolower [HTTP::header User-Agent]] contains MobileAgentList]} { HTTP::redirect http://m.site.com[HTTP::uri] } }
3 Replies
- Kevin_Stewart
Employee
As long as you're decrypting at the F5, your existing iRule should work the same, barring perhaps a redirect to https://m.site.com.
- Clayton_Wagner_
Nimbostratus
Hi Kevin,
Thanks for your response, but unfortunately it doesn't work the same. I did attempt with "https" as well.
Clayton
- Kevin_Stewart
Employee
How is it failing? What are you seeing?
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