mika
Aug 06, 2020Cirrus
REDIRCT HOST
Good morning! i want redirect a host to another host but with the same path, and i have many path! exmple: i have this hosts: https://www.abc.com/azer/iiokldf§123/kjiu to https://www.aze.com/aze...
You can use below iRule to redirect to the mentioned host keeping same URI path. Also if you want to match other condition for URI path like starts with. You can add another elseif statement given below and write iRule. Just you need to change the order of statements according to your use case under if-elseif statements.
if { [HTTP::uri] starts_with "azqsd"} {
HTTP::redirect https://host
when HTTP_REQUEST {
if { [HTTP::host] equals "www.abc.com"} {
HTTP::redirect "https://www.aze.com[HTTP::uri]"
}
}
Hope it helps!
Mayur