Forum Discussion
Michael_Powell1
Oct 04, 2010Nimbostratus
Redirect dependent on source IP address and URI
Hi there
I have created the following iRule for a shared application server:
when HTTP_REQUEST {
if {[matchclass [IP::remote_addr] equals $::private_net] && [HTTP::uri] contai...
Michael_Powell1
Oct 04, 2010Nimbostratus
OK my logic was broken. I wanted to check source IP address and destination URI then permit for a private address and redirect for a public address. Otherwise permit all other traffic. I have resolved it as follows:
when HTTP_REQUEST {
if { [matchclass [IP::remote_addr] equals $::private_net] && [HTTP::uri] contains "/uri_string_at/"}{
return
}
elseif {
[HTTP::uri] contains "/uri_string_a/"
}{
HTTP::redirect "http://www.example.com/"
}
else {
return
}
}
Thanks anyway for looking :-)
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