Forum Discussion
Tony_Hobson_189
May 06, 2015Nimbostratus
Cannot rewrite response.redirect using iRules
Hello all
Overview:
In a hosted environment, the edge is controlled by the Hosting company F5. This F5 terminates HTTPS and forwards HTTP to our virtual F5. This is running 11.6. Only HTTPS is...
Tony_Hobson_189
May 15, 2015Nimbostratus
Hello
Your suggestion was spot-on. Many thanks.
If anyone needs an example, here is what we used:
when HTTP_RESPONSE {
Set DEBUG
set DEBUG 0
if { [HTTP::is_redirect] }{
if { $DEBUG } { log local0. "*** REQUEST REDIRECT BEFORE *** STATUS:[HTTP::status] LOCATION:[HTTP::header Location]" }
HTTP::header replace Location [string map -nocase { "http://" "https://" } [ HTTP::header Location] ]
if { $DEBUG } { log local0. "*** REQUEST REDIRECT AFTER *** STATUS:[HTTP::status] LOCATION:[HTTP::header Location]" }
}
Check response type is text
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@http://@https://@}
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