Irule redirect help please

We have a e-comm website http://www.abc.com with store locator and I need to redirect like example shown below to all states within USA

http://www.abc.com/ohio should be redirected to .xyz Domain Names | Join Generation XYZ

but mainpage http://www.abc.com shouldn’t be redirected.

Need urgent help please.

Try this:

when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::uri]] {
        "/" {
            return
        }
        "/*" {
            set uri [string map {"/" "/store-"} [HTTP::uri]]
            HTTP::redirect "http://www.xyz.com${uri}"
        }
    }
}

It is not breaking the sequence

http://172.16.111.215/storestorestorestorestorestorestore-ohio/storestorestorestorestorestore-oreck