Forum Discussion

intadm_105683's avatar
intadm_105683
Icon for Nimbostratus rankNimbostratus
Oct 03, 2007

Http_Https_redirect

I would like to create an irule on my LTM unit which enables a redirect from http to https. However, I would to like to append as well anything users types in on url.

 

 

Ex. If users types in a.ab.com/abc, the LTM unit would redirect it to https://a.ab.com/abc.

 

 

I know on the BigIP, it would be Redirect https://h%/u%. What would be the simlar command on for the Irule on LTM??

 

 

Any help would be greatly appreciate.

 

 

Thanks.

2 Replies

  • Hey Colin...

     

     

    I tried that rule. But, when I type for example abc.abc.com/abc, it redirects to https://abc.abc.com. It doesn't append /abc.

     

     

    Any ideas?

     

     

    Thanks a lot for your help. Really appreciate it.
  • No slash is needed. HTTP::uri will never be an empty string, it always starts with a slash.

    You might try logging the value to the system log to make sure your inputs are correct.

    when HTTP_REQUEST {
      log local0. "Redirecting to https://[HTTP::host][HTTP::uri]..."
      HTTP::redirect "https://[HTTP::host][HTTP::uri]"
    }

    -Joe