Forum Discussion
jmolchin_47123
Nimbostratus
Feb 25, 2019Best way to redirect multiple URI's to a full URL
Hi, have multiple URI's that need to be redirected to the full URL, for example
/dev/v1/fedEx/fedexlabel-shipment REDIRECT TO: https://dev-warehouse-papi-dev.cloudhub.io/rest/v1/warehouse/fedExS...
AMiles_377865
Cirrocumulus
Feb 25, 2019Hello 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
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects