Joe_Erchul_4263
May 15, 2012Nimbostratus
Rewriting host and part of URI, then appending the remainder of the URI
Gang,
Trying to create an iRule to bail out my Application people. I need to modify the existing host to be a new host, then modify the "starts_with" portion of the URI, but also append the remainder of the URI for the end-user.
So, http://Server1/ThisURI/end-up-here.htm should rewrite to http://FinalDestination/new/end-up-here.htm
I've architected the following iRule that's not currently working:
when HTTP_REQUEST {
if { (([HTTP::host] equals "Server1") or ([HTTP::host] equals "Server2")) and
([HTTP::uri] starts_with "/ThisURI") } {
HTTP::header replace Host "FinalDestination"
HTTP::uri "/new[string range $uri 8 end]"
}
}
Any help would be much appreciated.
Thanks.
Joe