Forum Discussion
AlexB18
Sep 03, 2024Nimbostratus
iRule not working for URI Block
I have a virtual server www.xyz.com hosted on LTM for HTTPS service
and i'm looking to block (403 response) one of the application URI which is https://www.xyz.com/MW/entryPoint.htm
I tried below irule but its not working .
when HTTP_REQUEST {
if { [HTTP::has_responded] } { return }
if {[string tolower [HTTP::host]] contains "www.xyz.com" && [string tolower [HTTP::uri]] eq "/MW/entryPoint.htm" } {
HTTP::respond 403
return
}
}
Any suggestions appreciated. Thanks.
You force the HTTP::uri to be lower case and compare it with a string with upper case letters. This can not work.
This should work (not tested):
when HTTP_REQUEST { if { [HTTP::has_responded] } { return } if { ([string tolower [HTTP::host]] eq "www.xyz.com") && ([string tolower [HTTP::path]] eq "/mw/entrypoint.htm") } { HTTP::respond 403 } }
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