Techitect
Jul 01, 2015Nimbostratus
Pool Selection Based on URI and URL Modification
I'm trying to write an iRule that will redirect traffic to different pools based on URI, as well as altering the URL to remove the URI after the traffic is redirected to the correct pool. I think I have the initial pool redirect figured out, but I can't figure out how to do that AND THEN shorten the URL. Here are my examples:
- https://test.test.com/url1 to pool1 then remove /url1
- https://test.test.com/url2 to pool2 then remove /url2
- https://test.test.com/url3 to pool3 then remove /url3
- https://test.test.com/url4 to pool4 then remove /url4
- https://test.test.com/ to pool5
This is what I ahve for the pool selection/redirection:
when HTTP_REQUEST {
switch -glob -- [string tolower [HTTP::path]] {
"/url1*" {
pool /Common/Pool1
return
}
"/url2*" {
pool /Common/Pool2
return
}
"/url3*" {
pool /Common/Pool3
return
}
"/url4*" {
pool /Common/Pool4
return
}
"/*" {
pool /Common/Pool5
return
}
}
Thanks all!!