Forum Discussion
Apr 25, 2014
Assuming that the page is on the same server all you'd need is to change the uri before passing it forward:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
if { $host equals "lion.dev.leo.world.com" and $uri equals "/lookout" } {
HTTP::header replace Host "bearcub.dev.leo.world.com"
}
}
Now, if there's any images, stylesheets ets below /lookout that needs to be loaded you might be better off by using this:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
if { $host equals "lion.dev.leo.world.com" and $uri starts_with "/lookout" } {
HTTP::header replace Host "bearcub.dev.leo.world.com"
}
}
If the other bearcub.dev.leo.world.com resides on another server you will want to add a pool decision as well:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
if { $host equals "lion.dev.leo.world.com" and $uri starts_with "/lookout" } {
HTTP::header replace Host "bearcub.dev.leo.world.com"
pool bearcub_pool
}
}
/Patrik