Forum Discussion
nitass
Apr 29, 2014Employee
I don't think it will work in this situation.
why not?
e.g.
config
[root@ve11a:Active:In Sync] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
vs-index 9
}
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [class match -- [string tolower [HTTP::path]] starts_with redirect_class] } {
HTTP::redirect "http://[class match -value [string tolower [HTTP::path]] starts_with redirect_class]"
}
}
}
[root@ve11a:Active:In Sync] config tmsh list ltm data-group internal redirect_class
ltm data-group internal redirect_class {
records {
/groupon {
data m.site.com/1231
}
/hilton {
data m.site.com/1233
}
/shoprunner {
data m.site.com/1232
}
}
type string
}
test
[root@ve11a:Active:In Sync] config curl -I http://site.com/groupon/something
HTTP/1.0 302 Found
Location: http://m.site.com/1231
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://site.com/shoprunner/something
HTTP/1.0 302 Found
Location: http://m.site.com/1232
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://site.com/hilton/something
HTTP/1.0 302 Found
Location: http://m.site.com/1233
Server: BigIP
Connection: Keep-Alive
Content-Length: 0