Forum Discussion

stephon_87914's avatar
stephon_87914
Icon for Nimbostratus rankNimbostratus
May 12, 2011

HTTP::redirect causes infinite loop

Hello all,

 

 

We have written a iRule in attachment

 

But we found that results in an infinite loop while doing HTTP::redirect

 

Other functions (e.g: HTTP::retry) work fine

 

 

Would any one please help to resolve this issue?

 

 

Thanks a lot.

 

--

 

stephon

 

  • Hi Stephon,

     

    I took a quick look at the code. However, I think you are running into a loop because you are re-processing the redirect back into the iRULE and it's matching a statement that doesn't assume that the client is already being redirected the link.

     

     

    There are many different ways to stop this loop, however, the one that I think is the easiest is the following untested irule

     

     

    
    .
    .
    .
    } elseif {!([HTTP::request] eq "http://errorimg.org/noaccess.png") and ($lookup == 2) } {
        log local0.debug "No cdn [HTTP::host] [HTTP::uri]"
        HTTP::redirect "http://errorimg.org/noaccess.png"
      }
    .'
    .
    .
    

     

     

     

    I hope this helps

     

    Bhattman