Forum Discussion

spacecc's avatar
spacecc
Icon for Altostratus rankAltostratus
Jul 25, 2024

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...
  • spacecc's avatar
    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.