Forum Discussion

cathy_123's avatar
cathy_123
Icon for Cirrus rankCirrus
Nov 07, 2017

F5 redirection not working

Hi Guys,

Can you help me with this we are using redirection for a long time now. However not sure what is the issue on my irule.

When the user enters it will be redirected to http://www.abc.com/s?rch=&q=qrs+tuv

below is my irule

when HTTP_REQUEST {
if {[string tolower [HTTP::host]] contains "www.abc.com"} {
        if {[string tolower [HTTP::uri]] starts_with "/n/abc-def,-ghi-jkl/mno-2061"} {                 

  HTTP::redirect "http://www.abc.com/s?rch=&q=qrs+tuv"

          }
  }
}

Not sure why it is not working probably because of long uri? Please help

2 Replies

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    Try this

    when HTTP_REQUEST {  
        if { ([string tolower [HTTP::host]] contains "www.abc.com") and ([string tolower [HTTP::uri]] starts_with "/n/abc-def,-ghi-jkl/mno-2061") } {
            HTTP::redirect "http://www.abc.com/s?rch=&q=qrs+tuv"
        }
    }
    
  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    The problem might be the

    ,
    in the URI. It is a reserved word of the HTTP protocol. Are you sure it is indeed part of your URI as shown here? If it is not used as param separator, it should come in encoded as
    %2C
    .