Rewrite URL on Request, and then Rewrite URL on response
Hi All,
We have several country specific urls tied to the same VIP. Our sever is designed to accept connection on an internal url (internalurl.com for the example below) and produce country specific content according to the added HTTP header (bla_site) I am trying to take a request for these urls, rewrite them to the internal URL with an added HTTP header that = the original url set as a variable ($header2). Once that has been processed by the server, rewirite the outgoing url back to the original URL the customer requested. I can get this to work with 1 url, but as soon as I introduce the variable, it doesn't seem to work.
Here is what I have so far:
when HTTP_REQUEST {
set header_host [string tolower [HTTP::host]]
HTTP::header insert bla_site $header2
HTTP::header replace Host internalurl.com
switch -glob [string tolower [HTTP::uri]] {
default { DEFAULT_POOL
pool pool_Default
}
}
}
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
HTTP::header replace Location [string map [ list internalurl.com $header2 ] [HTTP::header Location]]
set location $header2
}
}
Hopefully this is descriptive enough to make sense. Thanks