Forum Discussion
greenasp_41938
Nimbostratus
Aug 11, 2009Redirect url by subfolder
We currently have a domain that points to a set of servers (www.abc.com), however, we have a new requirement to have certain sub directories (not all) point to another set of servers. (i.e.- www.abc.c...
Aug 11, 2009
That can be done in several ways. By a "set of servers", I assume you are referring to a "pool" in BIG-IP terminology. If this is the case, a simple iRule that inspects the URI can change the pool the connection is going to. Something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/content*" {
pool pool_1
}
"/othercontent*" {
pool pool_2
}
default {
pool pool_default
}
}
}
This way any request to "/content*" will get routed to pool "pool_1", requests to "/othercontent*" will go to pool "pool_2" and everything else will go to pool "pool_default".
The switch "-glob" allows for wildcard substitutions so you can do exact matches or wildcard matches as I did with the asterisks.
Hope this helps...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
