Forum Discussion
spacecc
Jul 25, 2024Altostratus
iRule http host with wildcard domain
Hi, I want to ask a question. I want to limit the http::host wildcard domain in iRule. Allow *.domain.com, but disallow *.*.domain.com. Such as if http::host is a.aaa.com or b.aaa.com, then go on. If...
- Jul 25, 2024
Thanks for all the advice. I have solved it.
when HTTP_REQUEST {
switch -regexp [HTTP::host] {
"^[a-zA-Z0-9_-]+\.domain.com" { }
default { drop }
}
}This irule works. Thanks all.
spacecc
Jul 25, 2024Altostratus
Thanks for all the advice. I have solved it.
when HTTP_REQUEST {
switch -regexp [HTTP::host] {
"^[a-zA-Z0-9_-]+\.domain.com" { }
default { drop }
}
}
This irule works. Thanks all.
- zamroni777Jul 25, 2024Nacreous
because there is only 1 condition, using "if else" is more efficient than "switch"
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