Vytautas_klior1
Mar 29, 2012Nimbostratus
http response uri rewrite based on server IP
hi folks,
I need to insert string (f.e. "/a1") on http response uri from specific server IP. For example if http response comes from server ip 10.10.10.1 then insert "/a1" in URI. It should look like this - if response is www.host.com/temp/temp1 then it should became www.host.com/a1/temp/temp1.
I do not have F5 for testing purposes and I don`t have much experience with irules..
I think that this irule should look like this, please correct if I am wrong.
Thanks in advice
when HTTP_RESPONSE {
if {(([IP::addr [IP::client_addr] equals 10.10.10.1]) and !([HTTP::uri] starts_with "/a1") } {
HTTP::respond "[HTTP::header]/a1[HTTP::uri]"
}
}