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
OK - I think I got it again - unless someone sees a problem with this performance wise:
when HTTP_REQUEST {
Check if path starts with /newsletters/directory2
if { [string tolower [HTTP::path]] starts_with "/newsletters/directory2"}{
Replace /newsletters/directory2 with /newsletters/directory3 in the path
HTTP::redirect [string map {/newsletters/directory2 /newsletters/directory3} [string tolower [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