Hi Kevhead,
to rewrite the HOST name for the provided URI you could use this code...
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/98/02/9802240_a.abc_med.jpg" } then {
HTTP::host "images.mydomain-b.com"
}
}
Note1: For LTM deployments prior to v11.5, you have to the code below...
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/98/02/9802240_a.abc_med.jpg" } then {
HTTP::header replace Host "images.mydomain-b.com"
}
}
Note2: The outlined code covers exactly your provided requirements. It changes the HTTP request for the given JPG file. If you need additional rewrites based on additional web directories or even for the entire site, then let us know. Be as precise as possible... 😉
Cheers, Kai