Forum Discussion

Victor_Im_96299's avatar
Victor_Im_96299
Icon for Nimbostratus rankNimbostratus
Sep 22, 2005

url redirect to different pool

Hello everyone,

 

 

I'm new to this forum and need some help in creating an irule.

 

 

Currently running BIG-IP Kernel 4.6.2 Build117 and need to redirect a url

 

(http://xml.company-corporate.net/client.asp) to another pool(lappr80). Not sure if I'm did this correctly but wanted to see if anyone can provide some assistance.

 

 

 

if (HTTP_REQUEST == http://xml.company-corporate.net/client.asp) {

 

use pool lappr80

 

}

 

else {

 

discard

 

}

 

 

 

Please help.

 

 

Thanks,
  • You'll want to use the http_host and http_uri variables

    if (http_host equals "xml.company-corporate.net"
        and http_uri starts_with "/client.asp") {
      use pool lappr80
    } else {
      discard
    }

    Check out the BIG-IP product manual for other relational operators you can use (ends_with, contains, matches_regex, etc).

    -Joe
  • I modified this rule a little bit so that traffic from "xml.company-corporate.net" redirects to another url "http://cache.company.com/client.asp" with the pool(lappr80). Would this rule below work? I cant do any testing of this rule because of it being on a production environment.

     

     

    Do the spaces inbetween each line of the rule affect how the rule works?

     

     

    if (http_host equals "xml.company-corporate.net"

     

    and http_uri starts_with "/client.asp") {

     

    redirect to "http://cache.company.com/client.asp"

     

    } else {

     

    discard

     

    }

     

     

    or like

     

     

     

    if (http_host equals "xml.company-corporate.net"

     

     

    and http_uri starts_with "/client.asp") {

     

     

    redirect to "http://cache.company.com/client.asp"

     

     

    } else {

     

     

    discard

     

    }

     

     

     

    Any input or help is appreciatd.

     

     

    Thanks,