For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Abuhasan_116587's avatar
Abuhasan_116587
Icon for Nimbostratus rankNimbostratus
Jun 03, 2016

question regardaing Irule

Hi All

Maintenance page is hosted in server.When type in https://abc.com i am getting maintenance page . However Acessing https://abc.com/*,its not redirecting to the Maintenance page .

For example Typing https://abc.com/test ,i am getting page not found.

How to include for check for ANY string in HTTP URI so that able to redirect to Maintenance page

when HTTP_REQUEST {

if {[HTTP::uri] starts_with "/ "} {

 HTTP::redirect "https://maintenancepage.com"

} }

Kindly suggest to resolve this

Thanks

1 Reply

  • Hi,

     

    Here a typical example. I added some more code to show you how switch works and also the use of HTTP::respond as an alternative to HTTP::redirect :

     

    when HTTP_REQUEST {
        switch -glob [HTTP::path] {
            "/test" {
                HTTP::redirect "https://test.com"
            }
            "/*" {
                HTTP::redirect "https://maintenancepage.com"
            }
            "/" {
                HTTP::respond 302 noserver "Location" "https://maintenacepage.com" "Cache-Control" "no-cache, must-revalidate"
            }
        }
    }