Issue with SetEnvIf!

m running the latest version of Litespeed Web Server Enterprise v4.2.6 and I have a apache .htaccess file, a load balancer in front of a litespeed cluster and im running magento. Sites SSLs are accelerated at the load balancer and so when magento redirects to HTTPs it needs to think its already there when in reality the SSL connection is terminated at the load balancers and from the LBs to litespeed its only HTTP. To do this I need the following to work in the .htaccess file for litespeed:
SetEnvIf X-Forwarded-Proto https HTTPS=on

Currently when litespeed is enabled, magento just does a 301 redirect forever since it doesnt see its in HTTPS via the X-Forwarded-Proto header the Load Balancers are sending. I need this or a way to do the same in litespeed. I tried the following but it didnt work.

RewriteCond %{HTTP:X-Forwarded-Proto} ^https$
RewriteRule .* - [E=HTTPS:eek:n]
Last edited: