Forum Discussion
Mayur_Sutare
MVP
Hi,
You can have below iRules on your VS to achieve your requirement.
iRule 1 -
when HTTP_REQUEST {
if { ([HTTP::host] equals "example.com") && ([HTTP::uri] starts_with "/vpc") } {
HTTP::respond 301 Location "https://example2.net"
}
}
iRule 2 - For Pool selection
when HTTP_REQUEST
{
switch [HTTP::host] {
"example2.net" {pool example2_pool}
}
}
You can bind these iRules to your virtual server so it will match for desired requests, rest requests will be forwarded to the default pool.
Hope it helps!
Mayur
GwIDsON
Dec 21, 2020Nimbostratus
Hi. I did not add that 301 also cannot be used. My bad, sorry for that The thing is that we cannot add DNS entry with example2.net. So the user can only connect using example.com and all the redirect to example2.net/ needs to be done on the F5. I hope it's possible. However I'm not sure if there will be an issue after the user will get the response from example2.net. It's complicated :D