Forum Discussion
DaveC_21078
Altostratus
Feb 07, 2011Change path
I have a URL where I need to alter the path, to eliminate the SSL in or w/o caring what comes afterSSL/. I thought it would fairly simple, but I can't get it to work. Thanks.
Colin_Walker_12
Feb 07, 2011Historic F5 Account
@Chris
If it's going to show up anywhere in the URI it's a bit more tricky. You'd need to find where that is first, then use the string command to do away with that section, or re-write it as necessary.
Something like:
when HTTP_REQUEST {
set uri [tolower [HTTP::uri]]
if { $uri contains "/ssl/" } {
set index [string first /ssl/ $uri]
set newuri [string replace [HTTP::uri] $index [expr $index + 3]]
HTTP::uri $newuri
}
}
This would look for the first instance of /ssl/ and replace /ssl (chars 0-3 starting at the index) with nothing, effectively removing them from the URI.
Not tested on the LTM, but tested in tclsh for syntax.
Colin
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