Forum Discussion

Anthony_Vaz_547's avatar
Anthony_Vaz_547
Icon for Nimbostratus rankNimbostratus
May 02, 2006

I'm really confused

Hi guys

 

Sorry this should be really simple, but I just can;t get it.

 

 

Basically - I am trying to setup a redirection rule.

 

 

What I want is, when a request comes in to a virtual server, and the URI is "/", I want the irule to interrogate the request, if there is a cookie called "LtpaToken", then go to pageA, but if the URI is "/" and there is no cookie called "LtpaToken", I want the Irule to redirect to Page B.

 

 

And I'm tying myself up in knots.

 

 

This is the closest I have got (and I know I'm miles away)

 

 

when HTTP_REQUEST {

 

if {[HTTP::uri] equals "/" } {

 

if {[HTTP::cookie exists LtpaToken] } {

 

HTTP::redirect "http://[HTTP::host]/wps/myportal"

 

} else {

 

HTTP::redirect "http://[HTTP::host]/wps/portal"

 

 

} else {

 

 

return

 

}

 

}

 

 

 

 

Should HTTP::cookie be available when I'm using HTTP_REQUEST? Can anyone help point me in the right direction?

 

 

Cheers