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...
Nov 21, 2006
The built-in string map TCL command is probably what you'll want.
Here's an example:
when HTTP_REQUEST {
set query [HTTP::query]
set new_query [string map {goto=http% goto=https% %3A80% %3A443% %3DEN %3DFR} $query]
HTTP::query $new_query
}-or- in one line:
when HTTP_REQUEST {
HTTP::query [string map {goto=http% goto=https% %3A80% %3A443% %3DEN %3DFR} [HTTP::query]]
}The first one is better for debugging...
-Joe
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