Forum Discussion
raddboy_74501
Nimbostratus
Dec 17, 2009Yet another URI rewrite
With our company divesting, I've been tasked with identifying incoming remote_addr, then intercepting certain URI content and modifying that URI on the fly.
Example: http://www.abc.com...
hoolio
Cirrostratus
Dec 17, 2009Hi Kevin,
You can rewrite the URI with HTTP::uri and the path with HTTP::path. Here is an example:
when HTTP_REQUEST {
Datagroup check loigic goes here
...
Check if path starts with /com/usa/
if {[HTTP::path] starts_with "/com/usa/"}{
Replace /com/usa/ with /com/usanew/ in the path
HTTP::path [string map {/com/usa/ /com/usanew/} [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