Forum Discussion
minphonemyatthu
Nimbostratus
Sep 19, 2018Block from Certain URI Access with irule.
Hello All,
Please help me to write an irule for the following requirements.
I have two accessible URL on a VIP ( and ) and want to block access from .
Is there another ways to block URL ac...
PeteWhite
Employee
Sep 19, 2018You can block access using an LTM policy. This has rules in which you select URIs etc and is more performant than an iRule.
Regarding your iRule, you seem to have used starts_with but the URI doesn't start with /ologin, it starts with //. Maybe use equals or ends_with instead:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "//ologin" } {
HTTP::respond 404 noserver return
}
}
You can also use HTTP::path which may be a bit more accurate as it doesn't contain the query string.
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