Forum Discussion

fcocquyt_104704's avatar
fcocquyt_104704
Icon for Nimbostratus rankNimbostratus
May 29, 2013

redirect to different pools

Hi,

 

 

 

It is probably a simple question however I'm not that familiar with irules.. I would need to have an iRule which checks if a url has a certain suffix.

 

For example if the url is www.example.com is should be directed to pool1

 

If the url is www.example.com/extrastuff it should be directed to pool2.

 

 

Is there a standard iRule for this ?

 

 

Thanks for all your help,

 

Frederik

 

2 Replies

  • In its simplest form:

    
    when HTTP_REQUEST {
       if { [string tolower [HTTP::uri]] starts_with "/extrastuff" } {
          pool pool2
       } else {
          pool pool1
       }
    }
    

    This will also send any URI that doesn't start with "/extrastuff" to pool1. You'll probably have to tweak the rule as you discover other URI paths.