Forum Discussion

Gill_32697's avatar
Gill_32697
Icon for Nimbostratus rankNimbostratus
Feb 13, 2014

irule usi else statement

so I need help with an I rule saying. If the url is https://imortgages.com or https://imortgages.mysite.local then ok just continue to default webpage. Else if any agent names /uri exits after url like https://imortgages.come/bill or https://imortgages.mysite.local/sue send it as a redirect to server 10.20.30.40 (node not defined in ltm but could if needed) for processing. I currently have an irule and a data group with all the agents or I can send the /uri to the server 10.20.30.40. ! ! when HTTP_REQUEST { if (only main /host then show default page from default pool member) This is working ) If any /uri then send entire header to server 10.20.30.40 as a redirect. (or if better option proccess data group below) else [class match [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } { HTTP::redirect [class match -value [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } } }

 

2 Replies

  • Perhaps something like this?

    when HTTP_REQUEST {
        if { [HTTP::uri] equals "/" } {
            return
        } else {
            if { [class match [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } { 
                HTTP::redirect [class match -value [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] 
            } else {
                node 10.20.30.40 80
            }
        }
    }
    
  • Yes, that is working a lot better. I'll tweak it a little more. Thanks again.