Forum Discussion
hooleylist
Aug 14, 2009Cirrostratus
Hi Dhananjay,
You can use an iRule to be more selective on which redirects to rewrite:
when HTTP_RESPONSE {
Check if server response is a redirect
if { [HTTP::header is_redirect] and [string tolower [HTTP::header Location]] contains "abc.com"} {
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 myold.hostname.com with mynew.hostname.com
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header value Location]]
}
}
Aaron