301 iRule redirect with a string to match in the URL

Hi I am looking for help to get 301 irule Redirect for my below URL. your immediate help would be much appreciated.i’m in a bit Crisis here now … :slight_smile: iRule Experts , over to you..

https://abcd.com/sites/swift/%uri% 301 redirect https://x.abcd.com/sites/swift/%uri%

but does not affect https://abcd.com/sites/taylorswift/url

Best Regards Mahi…

Try something like this:

when HTTP_REQUEST {
    if { ([HTTP::host] eq "abcd.com") and ([HTTP::uri] eq "/sites/swift/%uri%") } {
    HTTP::respond 301 Location "https://x.abcd.com/sites/swift/%uri%"
    }
}