in case you want to make it a bit more dynamic.
by the way, i think fragment identifier part (starting with hashmark) is not sent to bigip.
Fragment identifier
http://en.wikipedia.org/wiki/Fragment_identifier
configuration
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when RULE_INIT {
set static::removal "/abc/"
set static::hostname "www.f5.com"
set static::newhostname "new.f5.com"
}
when HTTP_REQUEST {
if { [HTTP::host] eq $static::hostname } {
HTTP::redirect "http://${static::newhostname}[string map [list $static::removal "/"] [HTTP::uri]]"
}
}
}
test
[root@ve11c:Active:In Sync] config curl -I http://www.f5.com/abc/TRIGGER/whatever/whatever
HTTP/1.0 302 Found
Location: http://new.f5.com/TRIGGER/whatever/whatever
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11c:Active:In Sync] config curl -I http://www.f5.com/abc/TRIGGER/calendar/render?tab=ncmain_7
HTTP/1.0 302 Found
Location: http://new.f5.com/TRIGGER/calendar/render?tab=ncmain_7
Server: BigIP
Connection: Keep-Alive
Content-Length: 0