Forum Discussion
iRule to redirect based on context
So there's no URI behind that address?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/123*" {
HTTP::uri "/"
pool pool_123
}
"/456*" {
HTTP::uri "/"
pool pool_456
}
"/789*" {
HTTP::uri "/"
pool pool_789
}
}
}
This modification will replace the incoming URI with an empty one. Of course at this point you have to be careful about how the application works. If a browser requests http://external.domain.com/123, and you send that to the first pool and change the URI to "/" (from /123), how does the web server respond? Does it respond with HTML content that points back to a specific URI pattern (ex. /123/images/mycat.png)? If the HTML document that you get back contains document objects that the browser is expected to go get (images, styles, scripts, etc.), you'll have to take into account how those URIs will be presented to the client.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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