Forum Discussion
muzammil_88686
Aug 15, 2011Nimbostratus
Redirection to another pool
Dear Dev Team,
We have two Virtual Servers as below.
Virtual Server1:
---------------
Virtual Server Name: VS1
Virtual Server IP: 10.1.1.1
Pool Name: PL1
...
Michael_Yates
Aug 16, 2011Nimbostratus
Hi muzammil,
After looking at what I gave you I have to apologize. The iRule that I gave you previously has the serious possibility of creating an endless loop and preventing proper site navigation.
Anything that began with “/test123” would get redirected, so on the target page you could have gone to “/test123/test1.html” and you would have gotten sent back to “/test123/test.html”.
The reason that the URI remained as “/test123” instead of “/test123/test.html” is because of this line:
HTTP::uri "/test123/test.html"
This caused the URI to be masked at the client (remain as “/test123” in the browser), but the Server received the modified URI.
This iRule will route the traffic for any URI starting with “/test123” to the proper pool, but will not handle the URI modification / redirect. I would suggest making the target a default document. Any additional logic could prevent you from having other documents in the same folder without being modified (not to say that it is not possible, I am sure that it is, but you would have to build in another layer of logic to handle it).
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/test123*" { pool PL2 }
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects