Forum Discussion
Joe_Pipitone
Jun 08, 2011Nimbostratus
Rewriting only part of the URI
I have a request to rewrite only a certain part of our URI, while still passing the last part of the URI. I need to be able to catch all requests and rewrite just part of the URI. I have a ...
Joe_Pipitone
Jun 08, 2011Nimbostratus
I think I've got it - I simply used a string map, and incorporated HTTP::redirect vs HTTP::path as to perform the rewrite / redirect.
when HTTP_REQUEST {
Check if path starts with /newsletters/Directory2
if {[HTTP::path] starts_with "/newsletters/Directory2"}{
Replace /newsletters/Directory2 with /newsletters/Directory3 in the path
HTTP::redirect [string map {/newsletters/Directory2 /newsletters/Directory3} [HTTP::path]]
}
}
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