Forum Discussion
tacobell_112236
Nimbostratus
Feb 21, 2011Redirect Based on IP
Hello all- Im a newbie- can someone assist .
I need to create an Irule wheras specefic URL's can only be accessed based on IP address(s) and if not on the IP range I need to redirect to ano...
Chris_Miller
Altostratus
Feb 21, 2011If you'd like to use data groups, I'd recommend creating a string-type group containing the URIs (in lowercase) and going from there. Also, you could consider doing a data group for the IP addresses if there's multiple ranges. From there, it'd be something like this:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] eq uri_datagroup] and [class match [IP::client_addr] ne address_datagroup] } {
HTTP::redirect "http://www.example.com" }
}
Basically, if their URI exists in the data group but their IP address doesn't, send them a redirect.
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