Forum Discussion

lisa_56349's avatar
lisa_56349
Icon for Nimbostratus rankNimbostratus
Sep 30, 2013

HTTP redirect intermittently working

Have been having an issue recently with HTTP redirect irules where they randomly stop working and show "page cannot be displayed", if you refresh a couple times the page will redirect. I am currently on version 9.3.1 LTM, upgrading soon but not yet. Here is a sample of a redirect that will randomly work.

 

when HTTP_REQUEST { if { [HTTP::uri] equals "/jazz" }{ HTTP::redirect http://myurl.com/default.aspx?pageid=160 } }

 

This has been verified on several ISP's and browsers.

 

4 Replies

  • Any chance that the request URI doesn't exactly equals "/jazz" - different case, additional content/query string added? Something like this would catch these two cases:

    when HTTP_REQUEST {
        if { [string tolower [HTTP::uri]] starts_with "/jazz" } {
            HTTP::redirect "http://myurl.com/default.aspx?pagedid=160"
        }
    }
    
  • I can reproduce this issue using lowercase, so forcing the code to use lowercase did not resolve the issue of it intermittently working. Thanks though...

     

  • I'd probably recommend some logging as a next step then:

    when HTTP_REQUEST {
        log local0. "Requested: -[HTTP::uri]-"
        if { [HTTP::uri] equals "/jazz" } {
            log local0. "Redirecting"
            HTTP::redirect "http://myurl.com/default.aspx?pagedid=160"
        }
    }
    

    Then look for "Redirecting" in the logs and the URI value right before it.

  • do you really not get redirected or does reaching the redirected page fail? if it is the first (check with some http browser plugin) then start tcpdump on the big-ip to check if the redirect isn't send.