Forum Discussion
kgaigl
Cirrocumulus
Oct 20, 2025IRule to block different combinations host/uri
hello together,
we've got a VIP with a lot of CNAME's and a few login-URI's should be blocked, but not all.
so in our Irule we have some Entries like:
elseif { [HTTP::uri] starts_with "/presse/login"}
{
HTTP::respond 403 but now we need special Combinations of
[HTTP::host][HTTP::uri]could you pls provide me some Example?
I'm not sure if [HTTP::host] matches alo for HTTPS.
Thank you
Karl
1 Reply
- Injeyan_Kostas
Nacreous
hi kgaigl
yes you can use [HTTP::host] for https too
You should though better use switch instead of if
check this https://clouddocs.f5.com/api/irules/switch.htmland this is an example
when HTTP_REQUEST { switch -- [string tolower [HTTP::host]] { "www.example.com" - "test.example.com" { switch -glob -- [string tolower [HTTP::path]] { "/presse/login*" { HTTP::respond 403 } } default { log local0. "Hit default for [HTTP::path]]" } } "abc.example.com" { log local0. "Hit rule for [HTTP::host]]" } default { log local0. "Hit default for [HTTP::host]]" } } }
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