Forum Discussion

Tom_White_69772's avatar
Tom_White_69772
Icon for Nimbostratus rankNimbostratus
May 14, 2008

iRule to redirect to Pool

We need to add an addendum to an existing iRule that will search for a URL/URI string and send those requests to a different F5 pool. If any of the following URL/URI combinations passes, we want to send them to the ESCMYURI_POOL.

 

 

https://mydomain.com/wps/myportal/escmyuri

 

https://mydomain.com/wps/portal/escmyuri

 

https://mydomain.com/wps/myportal/esccmyuri

 

https://mydomain.com/wps/portal/esccmyuri

 

 

Also, can we do this using the global switch command?
  •  
     switch [string tolower [HTTP::uri]] { 
         "wps/myportal/escmyuri" { 
                                   pool X} 
         "wps/portal/escmyuri { 
                                   pool Y} 
         defaut { 
                   ESCMYURI_POOL} 
      
     

    you can use the -glob option if you need : Click here

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Also, if you want to ensure that it's a particular domain AND a particular URI, you can expand the above example slightly to look for both:

     
     when HTTP_REQUEST { 
       switch "[HTTP::host][string tolower [HTTP::uri]]" { 
         "mydomain.com/wps/myportal/escmyuri" - 
         "mydomain.com/wps/portal/escmyuri" - 
         "mydomain.com/wps/myportal/esccmyuri" -  
         "mydomain.com/wps/portal/esccmyur" - 
         default { pool ESCMYURI_POOL } 
       } 
     } 
     

    Colin