sidiov
Jan 11, 2012Nimbostratus
transparent redirect question
Hi,
I want to take a request to a domain that contains a string and redirect based on that string without the client knowing a redirect took place (ie. getting different content based on that string - rather than being redirected based on that string)
The other part is that string needs to be removed during that request, because it doesn't actually exist.
Based on other stuff in devcentral, I was trying the following code, but it seems to be doing the exact opposite of what I want, its rewriting the header on the client side but pulling the data from the original host.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/11string11"}
{
set uri [string map {"/11string11" ""} [HTTP::uri] ]
HTTP::header replace "Host" "beta-s.domain.com"
HTTP::uri "$uri"
}
}
beta-s.domain.com is just a host out somewhere else not another vip/pool
So my goal is to have the request for http://s.domain.com/11string11/junk.txt return the content from http://beta-s.domain.com/junk.txt while keeping the original name on the client.