Forum Discussion
sistemaspcs_851
Nimbostratus
Jun 04, 2014Replace 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
- sistemaspcs_851
Nimbostratus
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]]" } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects