Well, not really, and that's the part that I need some help with. The second lookup is used to cut out the part of the original URI that I want to remove.
So, from the original uri /abc?xxxxxxx I want to remove just /abc and replace it with new.hostname.name/def. The problem that I'm running into is getting a way to match just the /abc from the original call.
I've put some comments in below to show what I'm trying to do so that you guys can tell the right way to do it.
Thanks all,
Cameron
IRule:
when HTTP_REQUEST {
set urlredir [class match -value [HTTP::uri] starts_with DATA-GROUP]
[HTTP::uri] = old.host.name/abc?xxxxxxxxx
urlredir = new.host.name/def
if { $urlredir ne "" }{
set replace [class match -value $urlredir starts_with DATA-GROUP]
replace = old.host.name/abc without any of the passed arguments.
set redir [string map "$replace $urlredir" [HTTP::uri] ]
redir = the original uri where /abc is replaced with new.host.name/def
and become new.host.name/def?xxxxxxx
HTTP::redirect ""
then redirected.
}
}
Data external group:
"/abc" : = "new.host.name/def",
"new.host.name/def" : = "/abc",