Forum Discussion

Brendan_Hogan_9's avatar
Brendan_Hogan_9
Icon for Nimbostratus rankNimbostratus
Sep 10, 2010

Error 310 when doing a maintenance redirect

My developer is trying to do a redirect that allows certain ip's to go to an application while all others are directed to an outage page. * In IE It partially works (but missing part of the application). *In Firefox I receive an error, “The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.” * In Chrome, I see the following error, "Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects." Using BIG-IP 10.1.0 Build 3341.48 Engineering Hotfix Here is the iRule when HTTP_REQUEST { set path [HTTP::uri] set host [string tolower [HTTP::host]] set bredirect 1 if { [IP::addr [IP::client_addr] equals 105.105.105.81] } { set bredirect 0 } elseif { [IP::addr [IP::client_addr] equals 105.105.105.236] } { set bredirect 0 } elseif { [IP::addr [IP::client_addr] equals 105.105.105.165] } { set bredirect 0 } if { [HTTP::uri] equals "/" }{ set path "/vccs/Main.action" } if { $bredirect == 0 } { HTTP::redirect "https://www.name.org$path" } else { HTTP::redirect "https://outage.name.org" } } Any suggestions???

1 Reply

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Brendan,

     

     

    Here's is a copy of your iRule with [ code ] [/ code ] blocks to preserve spacing:

     

     

    
    when HTTP_REQUEST {
       set path [HTTP::uri]
       set host [string tolower [HTTP::host]]
       set bredirect 1
       if { [IP::addr [IP::client_addr] equals 105.105.105.81] } {
          set bredirect 0
       } elseif { [IP::addr [IP::client_addr] equals 105.105.105.236] } {
          set bredirect 0
       } elseif { [IP::addr [IP::client_addr] equals 105.105.105.165] } {
          set bredirect 0
       }
       if { [HTTP::uri] equals "/" }{
          set path "/vccs/Main.action"
       }
       if { $bredirect == 0 } {
          HTTP::redirect "https://www.name.org$path"
       } else {
          HTTP::redirect "https://outage.name.org"
       }
    }
    

     

     

    Can you add logging to the iRule to record what's happening when the client receives too many redirects? I assume it's due to the iRule looping for an unanticipated reason.

     

     

    Are you adding this iRule to the HTTPS VS https://outage.name.org resolves to? If so, you might want to only redirect specific URIs like / or not redirect URIs that are required to serve the outage content.

     

     

    Aaron