Forum Discussion
jmeuse35_166730
Nimbostratus
Oct 22, 2014URL Rewrite - No redirection
A bit new to processing the irules and have a question which I hope the group can asisst with.
Scenario:
User URL: http://site.company.com/study1
F5 will rewrite the URL -> /ServiceStudyDB...
jmeuse35_166730
Nimbostratus
Oct 22, 2014Here is the solution that works:
when HTTP_REQUEST {
if {[HTTP::uri] contains "/study1"} {
HTTP::header remove "Accept-Encoding"
HTTP::header replace Location [string map -nocase {"study1" "ServicesStudyDB"} [HTTP::header Location]]
HTTP::uri "/ServicesStudyDB"
HTTP::uri [string map -nocase {"study1" "ServicesStudyDB"} [HTTP::uri]]
STREAM::disable
}
} when HTTP_RESPONSE { if {[HTTP::header Content-Type] contains "text"}{
set study1_uri [string map -nocase {"/ServicesStudyDB" "/study1"} [HTTP::header "Location"]] HTTP::header replace Location $study1_uriHTTP::header replace Location [string map -nocase {"ServicesStudyDB" "study1"} [HTTP::header Location]]
Replace 'old_text' with 'new_text'
STREAM::expression {@ServicesStudyDB@study1@}
Enable the stream filter for this response only
STREAM::enable
}
}
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