Forum Discussion
hooleylist
Feb 25, 2011Cirrostratus
You can use a switch statement for this as well. It's more efficient as you're not performing all three checks if a prior check was true.
when HTTP_REQUEST {
switch [HTTP::path] {
"/proposals/AccessControl.htm" {
HTTP::redirect "http://domain2.com/sub1/Construction/Proposals/AccessControl"
}
"/proposals/Davis.htm" {
HTTP::redirect "http://domain2.com/sub1/Construction/Proposals/Maintenance"
}
default {
HTTP::redirect "http://domain2.com/sub1/Construction"
}
}
}
If you have a lot more URIs to check for and they're all exact matches, you could add all of them to a string datagroup with a 'string' of the URI and a value which is the redirect URL. You can check the class wiki page for examples:
http://devcentral.f5.com/wiki/default.aspx/iRules/class
Aaron
Aaron