Forum Discussion

f5jr_113308's avatar
Icon for Nimbostratus rankNimbostratus
Jun 22, 2011

Help iRule Redirection to the same VIP

Hi All,



I have an URL that i wanted to redirect to when the user type the URL. I tried with the following URL. it just adds /infosell// many times and doesn't work.




if { [HTTP::host] equals ""} {


HTTP::redirect "https://[HTTP::host][HTTP::uri]/infosell/"









With the simple redirect rule below, i get redirect loop in the browser. I am a newbie to iRules






HTTP::redirect "https://[HTTP::host]/infosell/"







Can anyone help?




Thank you for help


2 Replies

  • You can write something like this:

     when HTTP_REQUEST {
      if { not ([HTTP::uri] starts_with "/infosell/") } {
        HTTP::redirect https://[HTTP::host]/infosell/
  • Colin_Walker_12's avatar
    Historic F5 Account
    I think what you're looking for is something like:

    when HTTP_REQUEST {
      if { ([HTTP::host] eq "") && !([HTTP::uri] starts_with "/infosell") } {
        HTTP::redirect "https://[HTTP::host]/infosell"

    That would redirect any request to that isn't going to to that directory. If you need something else, let me know.