Forum Discussion

slesh_219299's avatar
Mar 17, 2016

URL Maintenance Page irule

Hello guys I need some support with irule : - is it possible to change this irule in way when some specific www is requested than its going to MP . I dont need option with pool members = 0 there will be some work done on specific site

    when HTTP_REQUEST {  
      if { [active_members [LB::server pool]] == 0 } { 
    HTTP::respond 200 content {

                    xxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.}
} 
    } 
  • Can you elaborate what you mean by "when some specific www is requested"? Are you talking about an URI, an HTTP Host or something else??
  • Hi tatmotiv thanks for fast replay and : I mean f.e.: when someone wants to go to www.google.com/shop/x1 it will use

    HTTP::respond 200 content {
    
                    <h1><br><b>xxxxxxxxxxxxxx</b><br></h1>
           <b>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.}
    } 
       } 
    
    If its possible to create 1 for uri and 1 for host
    
  • I still do not exactly understand what you are planning to do, but generally speaking, it is possible to create an iRule that takes the URI and the host header into account. Taking your example above, the host would be "www.google.com" and the URI would be "/shop/x1". You can do with that whatever you like, e.g.:

    when HTTP_REQUEST {
      if { [HTTP::uri] starts_with "/shop/x1" } {
        HTTP::respond 200 content {  }
      }
    }
    

    or

    when HTTP_REQUEST {
      if { [string tolower [HTTP::host]] starts_with "www.google.com" } {
        HTTP::respond 200 content {  }
      }
    }
    

    Is that what you meant??