Forum Discussion
paulhaskew_7063
Nimbostratus
Jun 24, 2009Rewrite portion of URI?
Hi everyone. First off this forum/website has been invaluable for finding information and answering my questions for quite some time. Wonderful!
So to my question, I have a particular site...
hoolio
Cirrostratus
Jun 24, 2009What we are trying to do is dynamically replace the word someservice with someservice.svc in the URI string.
To literally do that you can use string map:
when HTTP_REQUEST {
Replace someservice with someservice.svc in the path of the request. Leave everything else in the path intact.
HTTP::path [string map -nocase {someservice someservice.svc} [HTTP::path]]
log local0. "[IP::client_addr]:[TCP::client_port]: Rewrote [HTTP::path] to\
[string map -nocase {someservice someservice.svc} [HTTP::path]]"
}
If you don't expect the someservice string to be in a majority of requests, you could first check to see if the path contains someservice before trying to rewrite it with HTTP::path.
Aaron
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