Forum Discussion

Brian_Mayer_841's avatar
Brian_Mayer_841
Icon for Nimbostratus rankNimbostratus
Mar 04, 2008

Redirect to specific pool based on URI pattern

Hey all,

 

 

I'm searching the forums for some help and haven't quite found what I'm looking for just yet. We need to redirect VS requests that match "pageid" in the URI to a different server pool. I found this snippet to use for redirection to a specific pool member, but I only need to redirect to the whole pool:

 

 

when HTTP_REQUEST {

 

set pool_member [findstr [HTTP:uri] "?" 1]

 

pool member $pool_member

 

}

 

 

What must I change to make redirect work to whole pool, rather than a member?

 

 

Thanks!

 

B

3 Replies

  • Hi,

     

     

    when HTTP_REQUEST {

     

    if {[HTTP::uri] contains "pageid"} {

     

    pool

     

    }

     

    }

     

     

    If the URI contains pageid the request will be send to the pool you'll specified after the key word pool.

     

     

    I'm surprised you didn't find anything about that in the forum.

     

     

    Next time try to have a look at the wikis
  • I'll give it a shot...to be honest, I'm new to iRules and really don't quite have the syntax down just yet. I've spent time on the Wikis but I'm still a newb. Thanks for the help.

     

     

    -B
  • It might also be good to handle requests where the parsed pageid doesn't equate to a valid pool. You can do this using the 'catch' command (Click here). You might also want to check that the pool has active members using the active_members command (Click here).

     

     

    Here is a similar request you could use as an example: (Click here)

     

     

    Aaron