Andrew
I finally got it working with the below irule but trying to add multiple urls in the request and not getting my syntax correct for the http response. Any help appreciate it.
when HTTP_REQUEST {
set external_hostname "tools.xyz.com"
set internal_hostname "tools.abc.com"
set external_hostname1 "test.xyz.com"
set internal_hostname1 "test.abc.com"
if { ([HTTP::host] equals $external_hostname) } {
HTTP::header replace Host $internal_hostname
}
if { ([HTTP::host] equals $external_hostname1) } {
HTTP::header replace Host $internal_hostname1
}
}
when HTTP_RESPONSE {
set external_hostname "tools.xyz.com"
set internal_hostname "tools.abc.com"
set external_hostname1 "test.xyz.com"
set internal_hostname1 "test.abc.com"
log local0. "The location header [HTTP::header Location] on response"
HTTP::header replace Location [string map -nocase "$internal_hostname $external_hostname" [HTTP::header Location]]
HTTP::header replace Location [string map -nocase "$internal_hostname1 $external_hostname1" [HTTP::header Location]]
}