Forum Discussion

Brent_Sachnoff_'s avatar
Brent_Sachnoff_
Icon for Nimbostratus rankNimbostratus
Oct 23, 2007

Using switch with uri

I'm having some issues using the switch command and uri's. I believe the switch command is only for EQUALS to something for it to work properly which means this wouldn't work at all. Here is a sample:

 

 

 

when HTTP_REQUEST {

 

switch [HTTP::uri] {

 

"/search/" { pool search }

 

"/int_search/" { pool search }

 

"/pictures/" { node 10.4.43.1 80 }

 

"/" { HTTP::redirect "https://[HTTP::host]/IMT/LoginAction.go" }

 

default {

 

pool www

 

}

 

}

 

}

 

 

is there a way to "match" vs equal on the uri in a switch statement?

 

starts_with "/search" or starts_with "/int_search/"

 

 

Thanks!

 

 

Brent

11 Replies

  • I was confusing two pieces of code there. I should have been using:

     

    HTTP::cookie insert name cc value "123456789" path "/cc"

     

     

    Using the above command, should that automagically add that to the header?

     

     

    How could I use this particular cookie for my persistence?