Forum Discussion
JamesSevedge_23
Historic F5 Account
Based on your question it seems like you are trying to receive requests from users at site.com/login and if it gets load balanced to server 1 changed the uri to be site.com/one, and site.com/two for server 2 etc.. Is that correct? How come each server can't have /login as the URI? Or at least one uri the same for all servers such as "/internallogin"? If that is the case the below iRule should work for simple redirection.
when HTTP_REQUEST {
if {[HTTP::uri] contains "/login"} {
HTTP::uri /internallogin
pool /Common/poolname
}
}
JamesSevedge_23
Feb 23, 2016Historic F5 Account
I would suggest the iRule I mentioned in my follow up comment then to rewrite the request based on lb decision made. I copied it again below. Just keep in mind you will need to rewrite the reponse coming back to fulfill your requirement that the user always think it is /login. The way to rewrite that would be to use the "when HTTP_RESPONSE" and then run the HTTP::uri command and change it back to /login if the response uri equals /one, /two or /three.
 
Referencing this... https://clouddocs.f5.com/api/irules/LB__server.html 
 
when HTTP_REQUEST_SEND { clientside { switch [LB::server addr] { "1.1.1.1" { HTTP::uri /one } "1.1.1.2" { HTTP::uri /two } "1.1.1.3" { HTTP::uri /three } } } }