Forum Discussion

Dixit_18200's avatar
Dixit_18200
Icon for Nimbostratus rankNimbostratus
Aug 13, 2009

Issue with irule in 9.4.7

Hi All,

 

 

We are having issues with irules created on 9.4.7. Below is the iruel we have added. But its not working. Please help.

 

 

when HTTP_REQUEST {

 

if {[HTTP::request] contains "www.acbg.com/ucc"} {

 

HTTP::redirect "https://microsite.accenture.com/ACBG/Solutions/UCandC/Pages/default.aspx"

 

}

 

}

3 Replies

  • My suggestion is to perform a debug

     
     when HTTP_REQUEST { 
        log local0. "This is the full Request: [HTTP::request]"  
        if {[HTTP::request] contains "www.acbg.com/ucc"} { 
           HTTP::redirect "https://microsite.accenture.com/ACBG/Solutions/UCandC/Pages/default.aspx" 
           } 
     } 
     

    otherwise you might want to switch to something like

     
     when HTTP_REQUEST { 
        if {([HTTP::host] eq "www.adbg.com")  and ([HTTP::uri] equals "/ucc") } { 
           HTTP::redirect "https://microsite.accenture.com/ACBG/Solutions/UCandC/Pages/default.aspx 
         } 
     } 
     

    Hope this helps

    CB

  • Checking the entire collection of request headers with HTTP::request will be less efficient. As cmbhatt suggests, the second option of checking the host and URI would be better. If it's an IIS based web app, you should also set the URI to lower case before checking it against the "/ucc" string.

     

     

    Aaron
  • Hi Aron/CB,

     

     

    The issue has been resolved now. We used ends_with string for resolving this issue. Also i have one more question, we have added this irule to the node which is configured to 443. However i am not sure why this was not working when we added the same irule to dummy node configured on port 80 as we were doing http redirect.