Forum Discussion

sistemaspcs_851's avatar
sistemaspcs_851
Icon for Nimbostratus rankNimbostratus
Jun 04, 2014

Replace URL string

Hello, I want to replace a string from URL, in this case the server behind the Big IP returns this url http://AAA.XXXX.net/common/Account/Login?ReturnUrl=http%3A%2F%2FAAA.XXXX.net%2Froadtransport%2F I want to rewrite it to: https://AAA.XXXX.net/common/Account/Login?ReturnUrl=https%3A%2F%2FAAA.XXXX.net%2Froadtransport%2F In the user´s browser

Is it possible? I was thinking in something like this:

when HTTP_REQUEST {
     if { [string tolower [HTTP::path]] contains "ReturnUrl" } {
          HTTP::redirect [string map {"http" "https"} [HTTP::uri]]
     }
}

But I don´t know if I´m in the right way. Any idea to solve this problem?

1 Reply

  • Finally I achieve it with this irule in the ssl virtual server

    when HTTP_RESPONSE {
         if { [HTTP::header Location] contains "ReturnUrl" }{
         HTTP::header replace Location "[string map {"ReturnUrl=http" "ReturnUrl=https"} [HTTP::header Location]]"
        }
    }