laurent_marion_
Jan 27, 2006Nimbostratus
https, http redirect tips & tricks
Hi,
i worked with irule and i have a small problem:
i have an internet website in https and http
my browser go to http://www.mywebip.com/
i want to follow this way:
if i connect to http://www.mywebip.com/ i redirect to https://www.webip.com/login
If i am on https://www.webip.com
i don't want to leave websecure server for all uri /login and /secure
but i ask another uri , i want to return in http mode.
My problem is the following:
when i connect http, i go to https, all is ok, but when https redirect to http, my website send me http://www.webip.com and i have a loop.
What can i do to avoid that?
I have a irule for http and a irule for https
my http irule is :
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" }{
HTTP::redirect "https://www.webip.com"}
my https irules is:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/login" } {
log "blahblah"
} elseif { [HTTP::uri] starts_with "/secure" } {
log "blahblah2"
} else {
HTTP::redirect "http://www.webip.com[HTTP::uri]" }
}
i am sure it's very easy, but i am starting with irule...
Thanks