Forum Discussion

vishnu1994's avatar
vishnu1994
Icon for Altostratus rankAltostratus
3 years ago
Solved

Need help with irule

Hi  I have an application xyz.com and we need only certain URI to be accessable and if the user directly go to xyz.com they need to get URL NOT ACCESSIBLE  and users only allowed to go to xyz.com/pa...
  • Kevin_Stewart's avatar
    3 years ago

    A simple switch might look like this:

    when HTTP_REQUEST {
       switch -glob [string tolower [HTTP::uri]] {
          "/page1" -
          "/page2" { }
          default {
              HTTP::respond 400 content "URL NOT ACCESSIBLE" "Connection" "close"
          }
       }
    }