SidHaz
Nimbostratus
Jul 12, 2019Search and Replace URL using iRule
I am very new to iRule and this could be very basic, so please bear with me.
We are having a change in the url context and hence all new urls will include a new context after the domain. I need a iRule which can make it backward compatible and replace/rewrite any urls hitting the F5 with the old context using new context.
Old URL: https://help.test.com/lmprd/ClickService?token=dsadasasdass
New URL: https://help.test.com/newprd/ClickService?token=dsadasasdass
The iRule need to look for anything hitting the F5, containing "lmprd" to be replaced with "newprd" and redirect after that. Everything else in the URL remains the same.
Any help will be highly appreciated.