Here is an example which checks the HTTP path (set to lower case for IIS apps) and sends a 301 response based on the datagroup entries you have above. Note that I've removed all checks of the host. If you want to add handling for other hosts, you can put the switch inside a check on HTTP::host. If you want to check if the requested path starts with the strings, you can add the -glob flag to the switch and add a * to the end of the path(s):
switch wiki page
http://devcentral.f5.com/wiki/default.aspx/iRules/switch
when HTTP_REQUEST {
Set the path to lowercase
switch [string tolower [HTTP::path]] {
"/land" {
HTTP::respond 301 Location "/Shows/land/tabid/26/Default.aspx"
}
"/aw" {
HTTP::respond 301 Location "/Shows/Advanced/tabid/45/Default.aspx"
}
"/attack" {
HTTP::respond 301 Location "/Shows/Attack/tabid/14/Default.aspx"
}
"/plenty" {
HTTP::respond 301 Location "/Shows/Plenty/tabid/27/Default.aspx"
}
"/blogs" {
HTTP::respond 301 Location "/Shows/Blogs/tabid/93/Default.aspx"
}
"/op" {
HTTP::respond 301 Location "/Shows/Plenty/tabid/57/Default.aspx"
}
"/derbury" {
HTTP::respond 301 Location "/Shows/derbury/tabid/58/Default.aspx"
}
"/central" {
HTTP::respond 301 Location "/Shows/Central/tabid/29/Default.aspx"
}
"/channel" {
HTTP::respond 301 Location "/Shows/tabid/397/Default.aspx"
}
"/church" {
HTTP::respond 301 Location "/Shows/derbury/tabid/58/Default.aspx"
}
"/events" {
HTTP::respond 301 Location "/Events/tabid/699/Default.aspx"
}
default {
Take some default action?
}
}
}
Aaron