Forum Discussion
Br3nt
Aug 13, 2020Nimbostratus
iRule to allow specific URL but block the root domain
We have a a mobile app that uses the URL /wfc. We need to block non-mobile access to the site by blocking the root domain from internet access. This iRule will be assigned to the VS that processes t...
atoth
Aug 17, 2020Cirrus
its best to give people the benefit of the doubt.
when HTTP_REQUEST {
if {[string tolower [HTTP::host][HTTP::path]] contains "/wfc"} {
<whatever pool or node you want to send traffic to>
} else {
HTTP::respond 403
}
}
Based on what you're describing, this should work. The second line of your irule has the "contains" modifier. This will find "/wfc" no matter where it's in the uri. If that's not your intention, you can also use "starts_with" or "ends_with" instead of "contains"
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