Forum Discussion
Chris_Corsaro_1
Nimbostratus
Mar 16, 2006uri pool redirection using single domain
Hello,
I need to redirect user connections from a single domain name with different virtual server directories. I am sorry but I'm very new to iRules, so please bear with me, I am truly a newbie.
This what we need:
We need to redirect users based on a URI they enter in a browser to connect to the correct client website via an F5 Pool.
For Example User enters in :
site.domain.net/client1
redirection needs to go to pool Client1-Pool
site.domain.net/client2
redirection needs to go to pool Client2-Pool
Site.domain.net/client3
redirection needs to go to pool Client3-Pool
I need to keep adding new client pools redirections to this iRule so please keep that in mind if there are any scalability issues. How would i Create this iRule?
would it go something like this?
when HTTP_REQUEST {
set uri [HTTP::uri]
if {$uri contains "client1" } {
pool Client1-Pool
}elseif {$uri contains "client2" } {
pool Client2-Pool
}elseif {$uri contains "client3" } {
pool Client3-Pool
}
}
- Your iRule should work just find. You might want to make the uri lowercase before you do a comparison in case your webserver is non case sensitive.
when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] if { $uri contains "client1" } { pool Client1-Pool } elseif { $uri contains "client2" } { pool Client2-Pool } elseif { $uri contains "client3" } { pool Client3-Pool } }
when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] if { $uri starts_with "/client1" } { pool Client1-Pool } elseif { $uri starts_with "/client2" } { pool Client2-Pool } elseif { $uri starts_with "/client3" } { pool Client3-Pool } }
- Chris_Corsaro_1
Nimbostratus
Thanks Joe. - Dave__Blodgett_
Nimbostratus
Joe - I work with Chris, and we have tried about a dozen different ways to get this to work. Still no success whatsoever.
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