Forum Discussion

Tristan_Rhodes's avatar
Tristan_Rhodes
Icon for Altostratus rankAltostratus
Mar 12, 2018

How to redirect with a custom path and append original URI?

I can create an LTM policy that redirects to a new host and keeps the original URI:

iptv.mydomain.com {
    actions {
        0 {
            http-reply
            redirect
            location https://www.mydomain.com[HTTP:URI]
        }
    }
    conditions {
        0 {
            http-host
            host
            values { iptv.mydomain.com tv.mydomain.com }
        }
    }
    description https://www.mydomain.com/tv/
    ordinal 1
}

But what I'd like to do is append the original URI to a specified path:

    location https://www.mydomain.com/tv[HTTP:URI]

However, BIGIP is saying that this is not a valid syntax. Is there a smart way to do this with LTM policies? Or do I need to create a custom iRule, and if so, how?

Thanks,

Tristan