Forum Discussion
Joe_5599_134300
Nimbostratus
May 03, 2016How can you block/reject subdirectories only, with an irule?
I want to block only the subdirectory and not the default or parent.
This irule I found on Dev Central and some others I have been testing with will also apply the reject to anything before the ...
Yann_Desmarest_
Nacreous
May 04, 2016Hello,
Ok, you just need to replace "*/appsite1" by "/appsite1" to make it works your way.
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/appsite1" { HTTP::respond 403 content "some html content explaining that the request is not allowed" }
}
}
and if you don't plan to add exceptions, you can use a simple if condition
when HTTP_REQUEST {
if { [HTTP::path] equals "/appsite1" } {
HTTP::respond 403 content "some html content explaining that the request is not allowed"
}
}
Joe_5599_134300
Nimbostratus
May 04, 2016Thanks, but none of these answers work.
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