Forum Discussion
Joe_Pipitone
Jan 26, 2011Nimbostratus
Stripping part of URI and integrating with iRule
I have to perform the following: http://www.oursite.org/directory1/directory2/somepage.aspx needs to rewrite to http://oursite.org/somepage.aspx - essentially just stripping out directory1 and dir...
Chris_Miller
Jan 26, 2011Altostratus
My pleasure...also, I forgot a "/" so that's why the number 2 was getting placed onto your site name.
Give this a shot. We'll tweak the number of characters for string range to make it work.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/directory1/directory2" } {
HTTP::redirect "http://oursite.org/[string range [HTTP::uri] 11 end ]"
log local0. "/directory1/directory2 found, redirected"
}
}
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