Forum Discussion
C_D_18583
Nimbostratus
Nov 20, 2006Replacing in the URI ; http -> https and port 80 -> 443
What is the easiest way to rewrite the following string? Replacing in the URI http -> https and port 80 -> 443
Before:
https://testlab-d.tdx.dorion.com/amserver/UI/Login?go...
Steve_Manuel_11
Nimbostratus
Nov 24, 2006Hi Aaron
I'm really at a loss on this. Okay here goes. I trying to substitute specific stings in a URL as follows
Before URL that hits F5 from the client
https://secureinternal-d.tmi.telus.com/amserver/UI/Login?goto=http%3A%2F%2Fsecureinternal-d.tmi.telus.com%3A40%2Feperformance%2FLogin.do%3FLANGUAGE%3DEN
Desire is to change the URL to look like this
https://secureinternal-d.tmi.telus.com/amserver/UI/Login?goto=https%3A%2F%2Fsecureinternal-d.tmi.telus.com%3A443%2Feperformance%2FLogin.do%3FLANGUAGE%3DEN
What I found using your latest suggestion
when HTTP_REQUEST {
if {[HTTP::uri] contains "goto"} {
HTTP::query [string map {goto=http% goto=https% %3A80% %3A443%} [HTTP::query]]
}
}
is that the string map on the HTTP::query removes all strings before the first substitution in my case goto
goto=https%3A%2F%2Fsecureinternal-d.tmi.telus.com%3A443%2Feperformance%2FLogin.do%3FLANGUAGE%3DEN
What I need to do is somehow build a full URL either on the fly and send to the downstream node or through a 302 redirect. So my questions are
1.) How do I build the full URL?
Hope this helps
Steve
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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