Forum Discussion
NewTOF501_15047
Nimbostratus
Apr 10, 2014irule which check if uri contains services
I need a irule which check if uri contains services like http://domain.name.com/services" or "oservices" then send traffic to service_pool or oservice_pool but before that it should change uri to /wp...
a_pavlov_114144
Cirrus
Apr 10, 2014You should assign something like the following iRule to your virtual server:
when HTTP_REQUEST {
if { [HTTP::uri] contains "services" } {
HTTP::redirect "/wps/portal"
pool SERVICE_POOL
}
elseif { [HTTP::uri] contains "oservices" } {
HTTP::redirect "/wps/portal"
pool OSERVICE_POOL
}
}
a_pavlov_114144
Cirrus
Apr 10, 2014You can add some logging to your irule to make sure that conditions in if statement work fine. And then look in /var/log/ltm for your messages.
Like this:
when HTTP_REQUEST {
log local0. "URI = [HTTP::uri]"
if { [HTTP::uri] contains "services" } {
HTTP::redirect "/wps/portal"
pool SERVICE_POOL
log local0. "SERVICE POOL"
}
elseif { [HTTP::uri] contains "oservices" } {
HTTP::redirect "/wps/portal"
pool OSERVICE_POOL
log local0. "OSERVICE_POOL"
}
}
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
