Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

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 www.abc.com/n/abc-def,-ghi-jkl/mno-2061 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

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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"
    }
}
0
Comments on this Answer
Comment made 06-Nov-2017 by cathy_123 274

Still not working :(

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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.

0
Comments on this Answer
Comment made 06-Nov-2017 by cathy_123 274

Hi Jie!

yes it was included I just found solution just now some of the letters in the URI are in capital letters I have to type it in small letters for it to work

Thanks! :)

Thanks as well SNL!

0