10-Dec-2020
14:52
- last edited on
22-Nov-2022
15:12
by
JimmyPackets
This is not my realm so first time trying to do iRules, I have the following redirect code that works (remove actual site names):
when HTTP_REQUEST {
set new_path [string trim [string tolower [HTTP::path]]]
set new_site "https://abc.abc.com"
if { $new_path eq "/reseller" } {
HTTP::redirect "$new_site$new_path"
} elseif { $new_path contains "/reseller/" } {
HTTP::redirect "$new_site$new_path"
}
}
but what I really need to to able for xyz.abc.com/reseller to go to abc.abc.com/reseller without the browser URL changing to abc.abc.com. Is this even possible?
Solved! Go to Solution.
10-Dec-2020 23:54
It's possible if abs.abc.com site is accessible from the BigIP... By simply using a pool for abc.abc.com's (Even if you have to create a new one) to service requests that hit /reseller/
BTW, I'd use starts_with rather than contains... Otherwise the URL /something/reseller/something will get redirected as well, which doesn't match your stated requirement https://clouddocs.f5.com/api/irules/starts_with.html
i.e.
H
10-Dec-2020 23:54
It's possible if abs.abc.com site is accessible from the BigIP... By simply using a pool for abc.abc.com's (Even if you have to create a new one) to service requests that hit /reseller/
BTW, I'd use starts_with rather than contains... Otherwise the URL /something/reseller/something will get redirected as well, which doesn't match your stated requirement https://clouddocs.f5.com/api/irules/starts_with.html
i.e.
H