Forum Discussion

Ted_Smith_11168's avatar
Ted_Smith_11168
Icon for Nimbostratus rankNimbostratus
Dec 17, 2005

Newbie needs help

I need help with a rule. I set some cookie values and compare them-this part is woking fine. If the cokkie check is valid, I then want to check the uri. If the uri starts with/contains agencyctr I want to re-write the uri and re-direct user to https://host/center/templates/welcome.cfm.

 

 

If it doesn't contain /agencyctr allow through to Shared pool.

 

 

If cookie check fails send back to original site

 

 

Please forgive me, I am by no means a coder. I'm sure it shows!!

 

 

 

when CLIENT_ACCEPTED {

 

set ckname aac1

 

set ckvalue [IP::client_addr]

 

set ckdomain .mydomain.com

 

}

 

when HTTP_REQUEST {

 

set uri [HTTP::uri]

 

set host [HTTP::host]

 

set new_uri /center/templates/welcome.cfm

 

set new_url $host$new_uri

 

if {[HTTP::cookie exists $ckname]} {

 

if { $uri != "agencyctr/welcom.cfm" } {

 

pool Shared

 

} else {

 

HTTP::redirect https://$new_url

 

}

 

} else {

 

HTTP::redirect "https://aac.mydomain.com$uri"

 

}

 

 

 

Thanks!!

2 Replies

  • Update:

     

     

    I think I solved my own problem...

     

     

     

    when CLIENT_ACCEPTED {

     

    set ckname aac1

     

    set ckvalue [IP::client_addr]

     

    set ckdomain .alliedinsurance.com

     

    }

     

    when HTTP_REQUEST {

     

    set uri [HTTP::uri]

     

    set host [HTTP::host]

     

    set new_uri /center/templates/welcome.cfm

     

    set new_url $host$new_uri

     

    if {[HTTP::cookie exists $ckname]} {

     

    if { $uri contains "agencyctr" } {

     

    HTTP::redirect https://$new_url

     

    } else {

     

    pool Shared

     

    }

     

    } else {

     

    HTTP::redirect "https://aac.alliedinsurance.com$uri"

     

    }

     

    }

     

     

    Thanks!!
  • Thanks for the update on the variables. I thought I had to set them before using them later. Good to know.

     

     

    Kind of a strange rule. In a different rule, I set this cookie value and then re-direct the user to this rule. In this rule I want to check the cookie value to make sure they came through the other rule. If they didn't and the cookie value doesn't match, kick them back! If it matches, let them through to the pool.

     

     

    I will do some testing with this new rule to see how it goes.

     

     

    Thanks again for your help!