Forum Discussion
Uri scalable redirects
having trouble with irule.i need to add these redirects based on the uri and will likely need y to add a few more so it need to be scalable. Programmers missed the missed the v3/ so Ii need an irule to correct as they add more uri's sites.... ! when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals {paymentprocessorv3/creditcard.asmx} { HTTP::redirect "https://mysite.zcorp.com/paymentprocessor/creditcard.asmx" } elseif{ [string tolower [HTTP::uri]] equals {paymentprocessorv3/ach.asmx} { HTTP::redirect "https://mysite.zcorp.com/paymentprocessor/ach.asmx" } }
--
1 Reply
- Hannes_Rapp
Nimbostratus
If you need configuration scalability, why not maintain your src-path to redirect-dst mappings in a String-type LTM data group
. An alternative to data-groups is an iFile. AFAIK, both are good options but LTM Data-groups parsing should outperform iFiles.LTM -> iRules -> Data-group List1. iRule Condition/Redirect statement:
if { [class match [string tolower [HTTP::path]] equals data-group-paths] ) }{ HTTP::respond 302 location "[class match -value [string tolower [HTTP::path]] equals data-group-paths" }2. data-group-paths (Type String) formatting:
“/path1/asd.asmx” value/description “https://somedomain.asd.com/1” “/path2/asd.asmx” value/description “https://somedomain.asd.com/2” ... “/pathx/asd.asmx” value/description “https://somedomain.asd.com/x”
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