Redirect all traffic coming to New IP(12.29.100.200) or blah.com or developer.blah.com to https://www.blah.comhttps://www.blah.com with carry forwarding the folder/parameters.
Some Examples:
a) http://12.29.100.200/blue~~http://12.29.100.200/blue~~ => https://www.blah.com/blue~~https://www.blah.com/blue~~
b) https://12.29.100.200/blue~~https://12.29.100.200/blue~~ => https://www.blah.com/blue~~https://www.blah.com/blue~~
c) http://12.29.100.200/blue?abc=123~~http://12.29.100.200/blue?abc=123~~ => https://www.blah.com/blue?abc=123~~https://www.blah.com/blue?abc=123~~
d) https://12.29.100.200/blue?abc=123~~https://12.29.100.200/blue?abc=123~~ => https://www.blah.com/blue?abc=123~~https://www.blah.com/blue?abc=123~~
The below does not work:
when HTTP_REQUEST {
HTTP::redirect “https://www.Blahcom[HTTP::uri]”
}
when HTTP_REQUEST {
HTTP::respond 301 Location ““https://www.blah.com” [HTTP::host] : 1][HTTP::uri]”
}
when HTTP_REQUEST { if {[string tolower [HTTP::host]] ne “www.blah.com”} { HTTP::redirect “https://www.blah.com [HTTP::uri]” } }
when HTTP_REQUEST {
if {[HTTP::host] equals “12.29.100.200”} {
if { ([HTTP::uri] contains “/*”) }{
HTTP::redirect “https://www.blah.com]”}
}
if {[HTTP::host] equals “blah.com”}{
if { ([HTTP::uri] contains “/*”) }{
HTTP::redirect “https://www.blah.com]”}
}
if {[HTTP::host] equals “dev.blah.com”}{
if { ([HTTP::uri] contains “/*”) }{
HTTP::redirect “https://www.blah.com]”}
}
As discussed, we do not have any server pool mapped to the VIP: 12.29.100.200 . We just want to have irule in place which will redirect traffic http or https coming to 12.29.100.200 or blah.com or developer.blah.com to https://www.blah.com/~~[https://www.blah.com](https://www.blah.com/)~~ with carry forwarding the folder/parameters. We are testing to the VIP!
Can someone please help with this irule!