iRule to redirect web page content

if i have web site and if i like to redirect to on pics.abc123.com/pics/abcd/efg/abc.jpg. how do i need to preserve the path? and do the redirect?

thanks in advance..

if u wanna do it for only jpg/jpeg files:

when HTTP_REQUEST {
    if { [HTTP::path] ends_with ".jpg" || [HTTP::path] ends_with ".jpeg"} {
        HTTP::redirect "pics.abc123.com[HTTP::uri]"
    }
}