Forum Discussion
Ravi_Rajan_7549
Nimbostratus
Feb 16, 2007Redirect Rule with MatchClass
Hi,
I am new to irules and need some help. I have a current rule like this -
when HTTP_REQUEST {
if { [matchclass [ string tolower [HTTP::uri] ] contains $::xyz]}
{HTTP::redirect "http://172.25.10.10/offline/appsoffline.html"}
}
Above will match the incoming uri with the datagroup and will take appropriate action.
I want the reverse of it, like If the URI matches the datagroup pass the request as it is and if some other URI comes in, then do a http::redirect.
TIA,
Ravi
2 Replies
- You can either use the "!" (not) operator or an else clause.
when HTTP_REQUEST { if { ![matchclass [ string tolower [HTTP::uri] ] contains $::xyz] } { HTTP::redirect "http://172.25.10.10/offline/appsoffline.html" } }
when HTTP_REQUEST { if { [matchclass [ string tolower [HTTP::uri] ] contains $::xyz]} { } else { HTTP::redirect "http://172.25.10.10/offline/appsoffline.html" } }
- Ravi_Rajan_7549
Nimbostratus
Thanks Joe, it worked
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