Forum Discussion

Singh_74932's avatar
Singh_74932
Icon for Nimbostratus rankNimbostratus
Jul 28, 2008

what' wrong with iRule ?

when HTTP_REQUEST {

 

 

if { (([HTTP::host] equals "abc.com") or ([HTTP::host] equals "www.abc.com") or ([HTTP::host] equals "isp1.abc.com ") or ([HTTP::host] equals "isp2.abc.com")) and not [HTTP::uri] equals "/admin/f5.txt"}

 

 

{

 

 

HTTP::redirect "http://www.xyz.com"

 

 

}

 

 

elseif { (([HTTP::host] equals "pqr.com") or ([HTTP::host] equals "www.pqr.com")) and not [HTTP::uri] equals "/admin/f5_pqr.txt" } {

 

 

HTTP::redirect "http://www.xyz.com/[HTTP::uri]"

 

 

}

 

 

else

 

 

{

 

 

pool MY_DEFAULT_POOL

 

 

}

 

 

}

 

 

Will this work .. or is this thing require HTTP profiles to be setup on VS ?

 

 

1 Reply

  • To inspect/modify HTTP content using the HTTP_ events and HTTP:: commands you need to instruct TMM to parse the request as HTTP by adding an HTTP profile to the VIP.

     

     

    Also, I think you need to enclose the condition you're not'ing in parentheses:

     

     

    and not ([HTTP::uri] equals "/admin/f5_pqr.txt") } {

     

     

    Aaron