irule redirect for 4 sites

Need some assistance setting up an iRule to redirect the following 4 sites:

Number 1:

http://ts1.domain.com/com/CollaborationCentral/PublishingImages/Test/OpexLogo.gif

redirect to:

https://site.domain.com/ep-common-components-stg/images/OpexLogo.gif

Number 2:

http://ts1.domain.com/com/CollaborationCentral/PublishingImages/Test/GreenBanner.jpg

redirect to:

https://site.domain.com/ep-common-components-stg/images/GreenBanner.jpg

Number 3:

http://ts1.domain.com/com/CollaborationCentral/PublishingImages/Test/Prop.jpg

redirect to:

https://site.domain.com/ep-common-components-stg/images/Prop.jpg

Number 4:

http://ts1.domain.com/com/CollaborationCentral/PublishingImages/Test/CompLogo.jpg

redirect to:

https://site.domain.com/ep-common-components-stg/images/CompLogo.jpg

Confirm the source details, where you are trying to redirect or URI matching condition…

In this case, I need both the URL and URI.

Try below iRule. Hope it will work for your requirements.

when HTTP_REQUEST {
        if { [string tolower [HTTP::host]] equals "ts1.domain.com" } {
            switch [HTTP::uri] {
           "/com/collaborationcentral/publishingimages/test/opexlogo.gif" {
            HTTP::redirect "https://site.domain.com/ep-common-components-stg/images/OpexLogo.gif"        
             }
             "/com/collaborationcentral/publishingimages/test/greenbanner.jpg" {
            HTTP::redirect "https://site.domain.com/ep-common-components-stg/images/GreenBanner.jpg"
            }
          "/com/collaborationcentral/publishingimages/test/prop.jpg" {
            HTTP::redirect "https://site.domain.com/ep-common-components-stg/images/Prop.jpg"
            }
          "/com/collaborationcentral/publishingimages/test/complogo.jpg" {
            HTTP::redirect "https://site.domain.com/ep-common-components-stg/images/CompLogo.jpg"
            }
        }
    }
}

I’ll give it a test, thank you!!