Forum Discussion
Abhijit_Vichare
Oct 29, 2020Nimbostratus
IRule for URL redirect
We need to configure an IRule in F5 for redirecting URL. The source URL will have an object id in its URI which we need to fetch and append it in the destination URL. Source URL can come in two...
jaikumar_f5
MVP
You can use the getfield option to extract that objectid, something like, if there are multiple other hosts coming to this setup, you can add host condition and then take action too.
ltm rule objectid_redirect {
when HTTP_REQUEST {
set uri [HTTP::uri]
set id [getfield $uri "/" 5]
log local0. "ObjectID is $id"
HTTP::redirect https://redirect.mytest.com/api/LinkServ?objectID=$id
}
}
Hope it helps. Test & update us.
Abhijit_Vichare
Nov 03, 2020Nimbostratus
Thank you !!! We are still testing different scenarios but looks like it is working as expected.
- jaikumar_f5Nov 04, 2020MVP
Glad could be of help, Please mark thread closed if resolved.
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