iRule Redirection
Hi,
I am new to iRule section.
I have an iRule for http to https redirect and applied to a virtual server, So any traffic coming through my virtual server will be redirected to https.
when HTTP_REQUEST { HTTP::respond 301 "Location" https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
Now, I want to exclude one specific domain( from http to https redirect.
Say,
http://Xyz.com & http://abc.com should be redirected to https://Xyz.com & https://abc.com
but if the traffic is http://oldsite.com ,it should not be redirected to https.
In Addition, I want the below one : http://oldsite.com should be redirected to http://newsite.com.
When HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "oldsite.com" and [HTTP::uri] equals "/") or ([string tolower [HTTP::host]] equals "www.oldsite.com" and [HTTP::uri] equals "/")} { HTTP::respond 301 Location "http://newsite.com" }
I want to combine these things and keep it in one iRule. Please help me.
Thanks in Advance.
Thanks, Sivaraj.