Forum Discussion
hooleylist
May 18, 2009Cirrostratus
Hi,
Here is a Codeshare example which shows how to remove the port from the Location header value in 30x redirects:
http://devcentral.f5.com/wiki/default.aspx/iRules/RewriteHTTPRedirectPort.html
when HTTP_RESPONSE {
Check if server response is a redirect
if { [HTTP::header is_redirect]} {
Log original and updated values
log local0. "Original Location header value: [HTTP::header value Location],\
updated: [string map ":[TCP::remote_port]/ /" [HTTP::header value Location]]"
Do the update
HTTP::header replace Location [string map ":[TCP::remote_port]/ /" [HTTP::header value Location]]
}
}
Aaron