Forum Discussion
Joe_Pipitone
Nimbostratus
Jan 26, 2011Stripping 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...
Joe_Pipitone
Nimbostratus
Jan 26, 2011Well, there's no need to use string map, I just realized that's not what I want as the URI needs to be rewritten
From:
http://oursite.org/directory1/directory2/somepage.aspx
to
http://oursite.org/somepage.aspx
I suppose HTTP::path would work too, however I haven't had luck with this iRule, still results in a strange loop:
when HTTP_REQUEST {
if { [HTTP::path] starts_with "/directory1/directory2" } {
HTTP::redirect "http://oursite.org[HTTP::uri]"
log local0. "/directory1/directory2 found, redirected"
} else {
HTTP::redirect "http://oursite.org[HTTP::uri]"
log local0. "go to homepage"
}
}
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