Forum Discussion

Thomson_Thomas's avatar
Aug 29, 2018

Redirect url to longer url

Hello need some help with an iRule redirect if possible:

 

we have two vips 80 and 443

 

80 vip has the standard https redirect irule "_sys_https_redirect"

 

we have a website at https://test.domain.com/ecm/login/auth and want users to get redirected to this full url when navigating to http://test.domain.com how can I achieve this? Any help is appreciated.

 

2 Replies

  • The port 80 VIP's redirect rule is best as is.

    Once on the port 443 VIP, you can use something like this to redirect to the correct URI:

    if { [HTTP::uri] equals "/" } {
        HTTP::redirect "/ecm/login/auth"
    }
    

    Keep in mind that even if the browser doesn't specify a trailing slash in the URL (ex. https://test.domain.com), the resulting HTTP::uri is still "/", so the above works for both "; and ";

  • Thomas,

     

    You can do it with a LTM policy instead of irule

     

    Create one rule in this policy

     

    • condition : http-host path is in /
    • action : http-reply redirect /ECM/login/auth