david_quint_204
Sep 25, 2008Nimbostratus
Simple HTTP redirects not working
Guys, I am having some issues with migrating an old iRule from v4.x to v9.45. We have an External IP address 65.170.177.8 (NAT'ed to an internal address ie:VIP) that has DNS entries for multiple URL's that are rarely used but need to be redirected to the new websites. The iRule is also checking to see if the request comes in on port 443 and redirects it to port 80. I know that we can probably clean up some of these things and make the rule more efficient. Can someone look at this iRule and see if they know why that I cannot get any redirects to work.
when HTTP_REQUEST {
if {[TCP::server_port] == 443} {
HTTP::redirect "http://[HTTP::host]/[HTTP::uri]"
} else {
if {[HTTP::host] == "www.newlifepubs.com" or [HTTP::host] == "newlifepubs.com"} {
HTTP::redirect "http://www.campuscrusade.com/nlp"
} elseif {[HTTP::host] == "www.mpd.ccci.org" or [HTTP::host] == "mpd.ccci.org"} {
HTTP::redirect "http://staffweb.ccci.org/mpd/index.aspx"
} elseif {[HTTP::host] == "www.staffweb.org" or [HTTP::host] == "staffweb.org" or [HTTP::host] == "staff.ccci.org"} {
HTTP::redirect "http://staffweb.ccci.org"
} elseif {[HTTP::host] == "myspam.ccci.org"} {
HTTP::redirect "https://spam.frontbridge.com"
} elseif {[HTTP::host] == "cars.ccci.org"} {
HTTP::redirect "http://cds.ccci.org/carschoose.asp"
} elseif {[HTTP::host] == "www.movementseverywhere.org" or [HTTP::host] == "movementseverywhere.org"} {
HTTP::redirect "http://www.ccci.org"
} elseif {[HTTP::host] == "www.movementseverywhere.net" or [HTTP::host] == "movementseverywhere.net"} {
HTTP::redirect "http://www.ccci.org"
} elseif {[HTTP::host] == "www.movementseverywhere.com" or [HTTP::host] == "movementseverywhere.com"} {
HTTP::redirect "http://www.ccci.org"
} else {
discard
}
}
}