Forum Discussion
rabid_gerbil_26
Apr 03, 2019Cirrus
For us a solution has been to add "elseif" or "return" statements to each iRule that has a issue. So far the change to add the "elseif" between each "if" statement appears to now work properly.
Hopefully if someone else has this same issue when upgrading their F5 to v14.1+ this will help them.
when HTTP_REQUEST {
if {[HTTP::has_responded]} {return}
Rewrite the User-Agent header value if it's empty
if { [string length [HTTP::header "User-Agent"]] == 0 || not [HTTP::header exists "User- Agent"] }{
Replace the User-Agent header with a default value
HTTP::header replace "User-Agent" "Mozilla/4.0 (compatible; No User Agent Provided)"
}
}
`
or
`when HTTP_REQUEST {
if {[HTTP::has_responded]} {return}
if { [HTTP::uri] equals "/portal/" or [HTTP::uri] equals "/"} {
if {[HTTP::host] starts_with "URL"}{
HTTP::redirect "http://www.URL.org/contact-us/contact-us.aspx"}
elseif {[HTTP::host] starts_with "path"}{
HTTP::redirect "http://www.anotherURL.com/Contact-Us/Contact-Us.aspx"}
elseif {[HTTP::host] starts_with "path1"}{
HTTP::redirect "http://www.anotherURL.com/applications/path1/contact-us.aspx"}
elseif {[HTTP::host] starts_with "path2"}{
HTTP::redirect "http://www.anotherURL.com/applications/path2/Contact-us.aspx"}
elseif {[HTTP::host] starts_with "path3"}{
HTTP::redirect "http://www.anthoerURL.com/applications/path3/contact-us.aspx"}
}
}