Forum Discussion
hooleylist
Nov 01, 2010Cirrostratus
I haven't checked all of the sample request/responses, but it looks like the app is URL encoding the redirect location. You could add URI decoding to the iRule to handle this:
when HTTP_RESPONSE {
Check if server response is a redirect and contains the wp-admin pattern (with URI decoding of the Location header)
if { [HTTP::header is_redirect] and \
[string match -nocase {*www.server.com/*/wp-admin*} [URI::decode [HTTP::header Location]]]} {
Log original and updated values
log local0. "Original Location header value: [HTTP::header value Location],\
updated: [string map -nocase "http:// https://" [HTTP::header value Location]]"
Do the update, replacing http:// with https://
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header value Location]]
}
}
Aaron