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
Would this hold true even though the redirect is different for each URI
/dev/v1/fedEx/fedexlabel-shipment https://dev-warehouse-papi-dev.cloudhub.io/rest/v1/warehouse/fedExShipment
/test/v1/fedEx/fedexlabel-shipment https://dev-warehouse-papi-test.cloudhub.io/rest/v1/warehouse/fedExShipment
/dev/WshSendTxnToOtmService/WshSendTxnToOtmService https://dev-otm-papi-dev.cloudhub.io/WshSendTxnToOtmService/WshSendTxnToOtmService
/test/WshSendTxnToOtmService/WshSendTxnToOtmService https://dev-otm-papi-test.cloudhub.io/WshSendTxnToOtmService/WshSendTxnToOtmService
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
