Can someone please assist me with writing an iRule that will help me direct incoming http/https requests to a specific URI?
I have 2 VIPs (different IPs, no name resolution yet, internal development) using the same pool of servers. The servers host 2 websites with URIs. I want requests coming into VIP 1 going to the 1st URI and requests coming into VIP 2 going to the other URI.
if you need more data, I will glady send this along.
Are your referring to this example? where “/prefix” is the uri
Make uri path start with /prefix if it doesn’t already
when HTTP_REQUEST {
if { not ([HTTP::uri] starts_with “/prefix”) } {
HTTP::uri /prefix[HTTP::uri]
}
}
The other example is with two separate pools. I am using the same pool with 2 different VIPs. What i’m trying to achieve is when an http request comes in to the vip it redirects to the URI. The URIs reside on the same pool of servers. Does that make sense?
and thanks for assisting.
You could probably redirect it by
HTTP::redirect “http://domain.com/\[HTTP::uri]”
what would the completed iRule look like? thanks