iRule for Redirect URI based on string

Hello ,

I want to redirect URI based on the URI string as mentioned below .

Can someone please help me to write the irule for below requirements

Not Transformed: ORIGINAL URL: This will pass through unchanged:

Transformed: ORIGINAL URL:

SHOULD BE TRANSFORMED TO:

Regards, Muthu

Hi,

try this local traffic policy (version 11.4.0 and above) instead of irule:

ltm policy Pol_eysso {
    controls { forwarding }
    requires { http }
    rules {
        DeepLinkKey {
            actions {
                0 {
                    http-uri
                    replace
                    path /eygsso/sso_login.aspx
                }
            }
            conditions {
                0 {
                    http-uri
                    path
                    values { /eysso/sso_login.aspx }
                }
                1 {
                    http-uri
                    query-parameter
                    name DeepLinkKey
                    values { - }
                }
            }
            ordinal 1
        }
    }
    strategy first-match
}

to install it, execute in tmsh load sys config merge from terminal and paste the code.

you can then enable it in virtual server.

Hi,

the - character is not the good filter…

replace the policy by:

ltm policy Pol_eysso {
    controls { forwarding }
    requires { http }
    rules {
        DeepLinkKey {
            actions {
                0 {
                    http-uri
                    replace
                    path /eygsso/sso_login.aspx
                }
            }
            conditions {
                0 {
                    http-uri
                    path
                    values { /eysso/sso_login.aspx }
                }
                1 {
                    http-uri
                    query-parameter
                    name DeepLinkKey
                    contains
                    values { 0 1 2 3 4 5 6 7 8 9 }
                }
            }
            ordinal 1
        }
    }
    strategy first-match
}