Forum Discussion
Malcom_Sargla_6
Nimbostratus
Oct 12, 2007Simple Http Redirect.. double 'IF' statement
Dear Central..
I am very new to Irules and really could use some assistance with one that I am working on.. again very new so I do apologize in advance if this is very basic.
1) Cl...
Deb_Allen_18
Oct 13, 2007Historic F5 Account
This iRule will redirect only clients in that IP class list who request URI's in that specific path. All other requests (those from other IP addresses or for other URI paths) will go to the default pool:
when HTTP_REQUEST {
if {([matchclass [IP::client_addr] equals $::test]) && \
([string tolower [HTTP::uri]] starts_with "/xxx")}{
HTTP::redirect "http://xxx.why.not.net[HTTP::uri]"
} else {
pool myPool
}
}
For this rule to work, you'll need to define a class called "test" of type Address that contains the IP addresses/subnets for which you want to redirect, and the pool myPool must also be defined.
HTH
/deb
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