Forum Discussion
Doug_104173
Nimbostratus
Jun 01, 2010Allow based on IP for uri starts_with
Hi, I am trying to come up with an iRule to only allow people to login to a certain page of our app if they originate from a single IP. Basically you can login to www.foo.com/admin if you come from 1...
Michael_Yates
Nimbostratus
Jun 01, 2010What you've got should do a good job.
My only suggestion would be to create a Data Group (iRules -> Data Group List -> Create (Group of Addresses)) that you could add additional qualifying IP Addresses to without having to add any to the actual iRule.
when HTTP_REQUEST {
if { ([HTTP::uri] starts_with "/admin") and ([matchclass [IP::remote_addr] equals $$IPAddressDataGroup]) } {
HTTP::redirect "https://foo.com/admin/index/index/"
}
else {
HTTP::redirect "https://foo.com/login/index/login/"
}
}
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
