Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

too many redirects

rondarf_352755
Nimbostratus
Nimbostratus

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 "; } }

 

1 REPLY 1

Lee_Sutcliffe
Nacreous
Nacreous

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/" 
    } 
 }