Forum Discussion

AnupamG_354580's avatar
AnupamG_354580
Icon for Nimbostratus rankNimbostratus
Jul 12, 2018

irule for url redirect and pool specific

Hi I have below requirement:

 

test-yyt-uat.ac/btty/* this should redirect to test-yyt-uat.ac/* pool A

 

test-yyt-uat.ac/* this should remain same to test-yyt-uat.ac/* pool B

 

Because my backened only accept test-yyt-uat.ac/*

 

1 Reply

  • Please ensure you search previous posts before posting, this is one of the most commonly asked questions and has been answered many times before.

    There is also an example of something similar in the iRule wiki:

    https://devcentral.f5.com/wiki/iRules.HTTP__uri.ashx

    This is an example of how you could rewrite your URI and select a pool based on this condition

    when HTTP_REQUEST {
        if {[HTTP::uri] starts_with "/btty" } {
            set newURI [string map {"/btty" ""} [HTTP::uri]]
            HTTP::uri $newURI
            pool poolA
        } else {
            pool poolB
        }
    }