Forum Discussion

nemmank's avatar
nemmank
Icon for Nimbostratus rankNimbostratus
Jul 20, 2011

iRule http 302 redirect not working

Hi all,

Any help is much appreciated. I am trying to use an iRule to redirect traffics inbound on one virtual server xxxx.com to another URL, yyyy.com with status code of 302. My iRule doesn' seem to be working as http request to xxxx.com doesn't get redirected. Below is my iRule which has been applied to virtual server for domain : xxxx.com

 

 

 

when HTTP_REQUEST {

 

if {( [HTTP::host] equals "xxxx.com")}{

 

HTTP::respond 302 Location "http://yyyy.com"

 

}

 

}

 

 

 

 

Please correct me if I am doing something wrong in the above.

 

 

 

Any help is much appreciated

 

1 Reply

  • Hi,

     

     

    That looks about right. What do you see in the browser when testing? Can you try testing from the LTM CLI using:

     

     

    curl -v 1.1.1.1 -H "Host: xxxx.com"

     

     

    where 1.1.1.1 is the virtual server IP?

     

     

    Aaron