Forum Discussion
Gurdip_Sira_172
Nimbostratus
Aug 14, 2016Help needed with an iRule to return 401 for sites
Hi,
I am working on an iRule that I would like to loop through a data group list and for each url in the site, return a 401 error for everyone bar one machine, who's IP I have in the condition (the...
Vijay_E
Cirrus
Aug 14, 2016Try this:
when HTTP_REQUEST {
if {not ([IP::addr [IP::client_addr] equals x.x.x.x]) } {
if { ([class match [string tolower [HTTP::host][HTTP::uri]] contains LegalSites]) } {
HTTP::respond 401 Location "http://[HTTP::host][HTTP::uri]"
}
}
}
For serving error page, look at this devcentral link and this link.
Check this for time-based iRule execution: link text
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