F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

4 Replies

  • Kevin and Michael, Thanks for your response.

     

    But it sounds like there is no better way if the request if a direct request or as a result of Redirect. I have tried below script and the result seems to be same(see below):

     

    when HTTP_RESPONSE {

     

    if { [HTTP::is_redirect] } {set a 1} if { [HTTP::header is_redirect] } {set b 1} if { [HTTP::header exists Location] } {set c 1}

     

    if { not ([HTTP::is_redirect]) } {set a 0} if { not ([HTTP::header is_redirect]) } {set b 0} if { not ([HTTP::header exists Location]) } {set c 0}

     

    set x [HTTP::is_redirect] set y [HTTP::header is_redirect] set z [HTTP::header exists Location]

     

    set result [format "x=%s y=%s z=%s a=%s b=%s c=%s" $x $y $z $a $b $c]

     

    HTTP::respond 200 content $result

     

    }

     

    RESULT: in any case the result is same as below! x=0 y=0 z=0 a=0 b=0 c=0

     

    So I am just not sure if any of these conditions are working.

     

    The redirection is trigger from another rule as below where myDNS is substituted: HTTP::respond 302 noserver Location "https://$uri"

     

  • So why not just do what you are trying to accomplish on the inital response before checking for a redirect? What is the end goal?

    when HTTP_RESPONSE {
    set a 0
    set b 0
    set c 0
    
    if { [HTTP::is_redirect] } {
        set a 1
        set b 1
        set c 1
       }
    
    }