Forum Discussion
hooleylist
Sep 26, 2006Cirrostratus
A one-liner for the Location header rewrite? This is close (no variables anyhow). Also, string map should be more efficient than regsub.
when HTTP_RESPONSE {
if { [HTTP::status] contains "302" && [string tolower [HTTP::header Location]] contains "host_to_replace" }{
HTTP::header replace Location [string map -nocase {"host_to_replace" "new_host"} [HTTP::header Location]]
}
}