Forum Discussion

jtostado_47719's avatar
jtostado_47719
Icon for Nimbostratus rankNimbostratus
Oct 21, 2009

BIGIP 4.5 to 9.3.1 iRule Conversion

I need help converting this rule:

 

 

if (http_uri ends_with one of portal_redirect_class) {

 

redirect to "https://psp-portal.com/portal/server.pt"}

 

else {

 

use pool SHAREPOINT

 

}
  • Hi Sumod,

    you could write it is

     
     . 
     . 
     . 
      
     else if { ([HTTP::uri] starts_with "/nos8") and !([HTTP::header "SSLClientCertStatus"] eq "OK" )  } { 
          HTTP::redirect "https://syst.com/nos8/" 
      
     . 
     . 
     . 
     

    I hope this helps

    Bhattman
  • Please help me to convert irule

     

     

    else if (http_uri starts_with "/nos8" and not (http_header("SSLClientCertStatus") == "OK")) {

     

    redirect to "https://syst.com/nos8/"

     

    }

     

  • There was syntax error on mine

     
     when HTTP_REQUEST {   
      if { [HTTP::uri] ends_with ".jpg" } {   
          HTTP::redirect "https://psp-portal.com/portal/server.pt" 
       } else {   
          pool SHAREPOINT 
          }   
      }  
     

    or

     
     when HTTP_REQUEST {   
      if { [HTTP::uri] ends_with $::portal_redirect_class } {   
          HTTP::redirect "https://psp-portal.com/portal/server.pt" 
       } else {   
          pool SHAREPOINT 
          }   
      }  
     

    Keep in mind that this is an example.

    CB
  • I got error with both!

     

     

    They both say:

     

    line 1 - parse error:missing close-brace

     

    line 2 - command is not valid in the current scope
  • I suppose it can be re-written to the following

      
     when HTTP_REQUEST {  
     if { [HTTP::uri] ends_with ".jpg" } {  
     HTTP::redirect "https://psp-portal.com/portal/server.pt"  
     else {  
     pool SHAREPOINT  
     }  
     }  
     

    or

     
     when HTTP_REQUEST {  
     if { [HTTP::uri] ends_with $::portal_redirect_class } {  
     HTTP::redirect "https://psp-portal.com/portal/server.pt"  
     else {  
     pool SHAREPOINT  
     }  
     }  
     

    I hope this helps

    CB