Forum Discussion
Aditya_Mehra
Cirrus
Nov 20, 2018Need to modify the uri via irule
Hi,
Need help for an iRule
condition:When url has both characters .xxx and / , then redirected url should not have / .
incoming url : https://a.b.c.com/aaa// abc/def/geh.x...
Lee_Sutcliffe
Nacreous
Nov 21, 2018Hi Aditya,
If using a traffic policy as Philip has suggested, is not an option, you could use the following iRule:
when HTTP_REQUEST {
set var1 "xxx"
set var2 "/"
set newHost "b.a.c.com"
if {([HTTP::uri] contains $var1) && ([HTTP::uri] contains $var2)} {
set newUri [string map -nocase [list $var2 ""] [HTTP::uri]]
HTTP::redirect https://${newHost}${newUri}
} elseif {!([HTTP::uri] contains "/")} {
HTTP::redirect https://$newHost[HTTP::uri]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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