Hi Thiyagu,
You can use this iRule to replace the first field in the URI path, regardless of what the field contains. It uses
getfield
which uses the forward slashes as delimiters and
string map
to replace what has been found, with a blank value.
when HTTP_REQUEST {
if {[HTTP::uri] contains "URI1"} {
set uriField [getfield [HTTP::uri] / 2]
set newUri [string map [list ${uriField}/ ""] [HTTP::uri]]
HTTP::uri $newUri
}
}
Getfield
https://devcentral.f5.com/wiki/irules.getfield.ashx
String map
https://devcentral.f5.com/articles/irules-101-14-tcl-string-commands-part-2