Forum Discussion
pgermain_71805
Nimbostratus
Aug 05, 2009URI Rewrite Help
We want to take all requests from a particular IP to a particular URI, and add an additional directory to the URI. We do not want to redirect.
For example, if a request from 2.2.2.2 co...
pgermain_71805
Nimbostratus
Aug 05, 2009Thanks Matt,
I have it working now with [HTTP::uri], plus some other ideas I lifted from other posts...
when HTTP_REQUEST {
start debug
set testuri [HTTP::uri]
log local0.debug "> ****StartURI='$testuri'";
end debug
if { ([IP::client_addr] equals "2.2.2.2") and ([HTTP::uri] starts_with "/SOAPAPI") } {
set variables
set origUri
set origString "/SOAPAPI";
set newString "/SOAPAPI/test";
regsub -all $origString $origUri $newString newUri
start debug
set testuri [HTTP::uri]
log local0.debug "> ****StartURI='$testuri'";
log local0.debug "> ****EndNewURI='$newUri'";
end debug
write the new URI to HTTP session
HTTP::uri $newUri
string replace
}
}
Much Appreciated,
Paul
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