Forum Discussion
david0512_20548
Nimbostratus
Nov 11, 2014http rewrite irule -- help!!
We have a requirement for a http rewrite but its driving me mad (as a newbie to irules and even after trawling through forums and docs) trying to get this right, and its been going on for weeks.
C...
R_Eastman_13667
Nov 11, 2014Historic F5 Account
You need to use the HTTP_RESPONSE event on your HTTP VS. Alos add the HTTP_REQUEST to capture the URI.
when HTTP_REQUEST {
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
if {[HTTP::is_redirect] && [HTTP::header value "Location"] contains "www.abc." && $uri starts_with "/t/"} {
HTTP::header replace Location [string map {www.abc. "www.xyz.com"} [HTTP::header value Location]]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
