28-Feb-2021 19:21
01-Mar-2021 00:32
Something like this should do,
if {(([HTTP::host] eq "abc.com") && ([string tolower [HTTP::uri]] starts_with "/path1")) || (([HTTP::host] eq "xyz.com") && ([string tolower [HTTP::uri]] starts_with "/path2")) } {
HTTP::redirect https://newsite.com/path3/abc
}
01-Mar-2021 11:35
Thanks,
Can we make this more simple like because abc.com and xyz.com is same means this part of URL is similar so lets consider this as abc.com for both sites but paths are different and should be redirected to same newsite.com.
01-Mar-2021 23:40
Hello,
You can modify above iRule as given below.
if {(([HTTP::host] eq "abc.com") && (([string tolower [HTTP::uri]] starts_with "/path1") || ([string tolower [HTTP::uri]] starts_with "/path2"))) } {
HTTP::redirect https://newsite.com/path3/abc
}
Hope it helps!
04-Mar-2021 01:06
Hi, use below iRule.
when HTTP_REQUEST {
if {(([HTTP::host] eq "abc.com") && (([string tolower [HTTP::uri]] starts_with "/path1") || ([string tolower [HTTP::uri]] starts_with "/path2"))) }
{
HTTP::redirect https://newsite.com/path3/abc
}
}
04-Mar-2021 11:05
Thanks It works
Both URLs are directed to single URL and successfully tested