Forum Discussion
how to create the iRule for redirecting traffic on URL context string?
2.1) I would like all web traffics that begin with the following URL context string https://192.168.10.1/YYYY* or https://10.10.10.1/YYYY* to be
directed to the default YYYY.YYYYY.com-https load balancer pool.
2.2) I would like to implement an irule redirect on all web traffics with the below listed URL context strings to redirect those web traffics to the new YYYY.WW.YYYYY.com-https pool.
https://192.168.10.1/WWWW- https://192.168.10.1/VVVV- https://10.10.10.1/WWWW- https://10.10.10.1/VVVV-
1 Reply
- Michael_Jenkins
Cirrostratus
You can do this with code like the following. As long as people are accessing the URL by ip address like in your example, it should work. Otherwise, You'll need to add some additional conditions in the switch statement to handle the alternate hosts.
when HTTP_REQUEST { switch -glob -- [string tolower "[HTTP::host][HTTP::uri]"] { "192.168.10.1/YYYY*" - "10.10.10.1/YYYY*" { pool YYYY.YYYYY.com-https } "192.168.10.1/WWWW-*" - "10.10.10.1/WWWW-*" - "192.168.10.1/VVVV-*" - "10.10.10.1/VVVV-*" { pool YYYY.WW.YYYYY.com-https } } }
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