Forum Discussion

Lucas_Kaczmarsk's avatar
Lucas_Kaczmarsk
Icon for Nimbostratus rankNimbostratus
Jan 28, 2016

Keep the original URL in browser address bar after redirect

Hello,

I have the following irule which redirects users to a holding page (holding.test.com) in an event of the pool failure. What I want to do is to keep the original URL (live.test.com) in a browser address bar after the redirect happens.

when HTTP_REQUEST {
if {[active_members LB06-HTTP-POOL]>0} {
      pool LB06-HTTP-POOL
  } else {
      log local0. "Holding page ENABLED for LB06-HTTP-POOL"
      HTTP::respond 302 Location   " http://holding.test.com/"
      }
}

Is that possible? Many thanks in advance.

Thanks, Lucas

2 Replies

  • Hi Lucas,

    A redirect does what it does... it simply redirects your client to a new location.

    So if you need to keep the original URL in your location bar, then you have to use a different way to access the Hold Page.

    See the examples below to get an overview of possible solutions...

    Scenario1: Accessing the Hold Page using the Hold Page Pool

    when HTTP_REQUEST {
        if {[active_members LB06-HTTP-POOL]>0} {
            pool LB06-HTTP-POOL
        } else {
            pool YOUR_HOLD_PAGE_POOL
        }
    }
    

    Scenario2: Accessing the Hold Page using the virtual server that is already using the Hold Page Pool

    when HTTP_REQUEST {
        if {[active_members LB06-HTTP-POOL]>0} {
            pool LB06-HTTP-POOL
        } else {
            virtual YOUR_HOLD_PAGE_VIRTUAL_SERVER
        }
    }
    

    Note: I would prefer Scenario1. It would have less overhead...

    Cheers, Kai