Then set your default path to poolB and all paths will go there except for the one in the irule.
your example seems in line.. synatax on the string map and you won't need a redirect.
if { ($requestURI starts_with "/rd/ui/")} {
HTTP::uri [string map "/rd/ui/ /" $requestURI]
pool ext_servername_pool
the string map will replace /rd/ui/ with a / and set the URI to that result
it will then switch to pool ext_servername_pool in place of the default pool
if you then issued a redirect it would process the iRule again and end up in the default pool.
good luck.