Forum Discussion
Alan_B__139698
Altostratus
Nov 06, 2018iRule help to restrict access to particular URI on vserver
I've been asked to restrict access to a site's "/admin" page to only the networks/IPs used by support techs. I was thinking a redirect to the primary site ("mysite.com" for the example) for such traf...
jaikumar_f5
Noctilucent
Nov 07, 2018Hey Alan,
Try this, make sure you create a Datagroup of admin_ips and add your require subnets in there, you can change the operator "starts_with" to something else (equals/contains) to match your requirements in future.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/admin" and (![class match [IP::remote_addr] equals admin_ips]) } {
HTTP::redirect "https://mysite.com"
}
}
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
