For 2 you could try something like this if you are wanting to use string map:
when HTTP_REQUEST {
if {[string tolower [HTTP::path]] starts_with "/us/foo"}{
HTTP::redirect "http://www.abc.com[string map -nocase {/us/foo /us} [HTTP::uri]]"
}
}
If you are just looking to redirect traffic going from www.abc.com/us/foo over to www.abc.com/foo then you could use a simple switch redirect like this:
I forgot to mention, if you use the switch command then the impact will be very minimal. I do not know the impact of using the string map, but I have used it on sites getting 100’s of requests a minute and haven’t noticed any kind of negative impact on the BIG-IP box or in using that site from a clients perspective.