Forum Discussion

rondarf_352755's avatar
rondarf_352755
Icon for Nimbostratus rankNimbostratus
Oct 19, 2018

too many redirects

have the iRule below and the page is coming back with too many redirects - I'm new to iRules - is this iRule creating a loop?

 

when HTTP_REQUEST { if {[http_host] equals "electronica2018.avnet.com"} { HTTP::redirect "; } }

 

  • Firstly, your syntax isn't correct

    http_host
    should be
    [HTTP::host]
    . Secondly you do not need a semicolon after the redirect.

    That said - you are issuing a redirect to a Host, based on the condition that the request matches the same Host header - therefore creating a loop.

    If you just want to amend the URI you can use the following iRule. Alternatively, this can be achieved using a Local Traffic Profile.

    when HTTP_REQUEST { 
        if {[HTTP::host] equals "electronica2018.avnet.com"} { 
            HTTP::uri "/wps/portal/e2018/" 
        } 
     }