On my site I redirect users with mobile devices to a mobile site using my Haproxy loadbalancer. I got some complaints about that and want to offer the users a link back to the "classic" portal. As not all sub-pages are available in a mobile format I have to select if the content is available or not first.
acl path_root path /
acl path_mobile path_beg /faq
acl site_classic hdr_sub(cookie) CLASSIC=
acl ua_smartphone hdr_reg(User-Agent) -i iphone ipod android bada
redirect location http://s.tld if path_root ua_smartphone !site_classic
redirect prefix http://s.tld if path_mobile ua_smartphone !site_classic
If the user is entering at the top level directory just redirect the location. If the "mobile" user hits content that is available in mobile format redirect including the full path. This all works fine so far.
Now I do not want to redirect the user anymore when s/he clicked a link in the mobile version that sets a cookie named "CLASSIC".
The cookie is set correctly and works fine. If I write the following the redirection works:
acl site_classic hdr_sub(cookie) CLASSIC=
redirect location http://s.tld if site_classic
I also tried all thinkable ways of checking the cookie, e.g. CLASSIC=1 CLASSIC=true CLASSIC=portal etc. and in code
acl site_classic hdr_sub(cookie) CLASSIC
acl site_classic hdr_sub(cookie) CLASSIC=
acl site_classic hdr_sub(cookie) CLASSIC=1
acl site_classic hdr_sub(cookie) CLASSIC=true
acl site_classic hdr_sub(cookie) CLASSIC=portal
Why does it not work?
Thank you for your help!