Forum Discussion
Best way to redirect multiple URI's to a full URL
Hello John,
An iRule and data group would probably be easiest, yes. Make a string data group with the uri's that need to be redirected, and use that to decide the redirect. Here's a pretty good video on data groups if you need a refresher, and this post covers the basic steps on making an external group if your list of uris is big.
Here's some pseudo-code to get you on the right track for the iRule.
when HTTP_REQUEST {
if { [class match [HTTP::uri] equals uriGroup] } {
HTTP::redirect https://dev-warehouse-papi.dev.cloudhub.io/rest/v1/warehouse/fedExShipment
}
}That should work for v. 10 and above. I think older versions use matchclass instead of class, which would look like
if { [matchclass[HTTP::uri] equals uriGroup] } {Best of luck,
Austin
Okay yeah, there's a couple options you could try. My first thought is that each entry in the database could have a specific value that you use to differentiate between your redirects.
so for any entry uri you could be redirected to the value entered for that uri.
database: uriGroup string1: /example value1: https://dev-warehouse-papi-dev.cloudhub.io/rest/v1/warehouse/fedExShipment string2: /test value2: https://dev-otm-papi-test.cloudhub.io/WshSendTxnToOtmService/WshSendTxnToOtmService
Rinse and repeat.
HTTP::redirect https:// [class match -value [HTTP:uri] equals uriGroup ]
and then something like that for the code, which should redirect you based on the value you entered for that uri entry
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
