Conditional Headers in .htaccess

#1
In Apache 2.4.26 and above it's possible to use if else directives, like:

Code:
<If "%{HTTP:User-Agent} =~ /(android|blackberry|ipad|iphone|ipod|iemobile|opera\ mobile|palmos|webos|googlebot-mobile)/">
Header add Link "<https://example.com/fonts/font01.woff2>; rel=preload; as=font; type=font/woff2;"
</If>
<Else>
Header add Link "<https://example.com/fonts/font02.woff2>; rel=preload; as=font; type=font/woff2;"
</Else>
Does anyone know how to achieve the same in LSWS?
 
Last edited:
#5
LiteSpeed 6.0 has been released, and it supports conditional context, I've tried the following command (set only Chrome browser with SameSite=None header) previously valid on Apache server, but with no luck, anybody try this successfully?

<If "%{HTTP_USER_AGENT} !~ /(iPhone; CPU iPhone OS 1[0-2]|iPad; CPU OS 1[0-2]|iPod touch; CPU iPhone OS 1[0-2]|Macintosh; Intel Mac OS X.*Version\x2F1[0-2].*Safari|Macintosh;.*Mac OS X 10_14.* AppleWebKit.*Version\x2F1[0-3].*Safari)/i">
ForceSecureCookie httponly secure same_site_none
</If>
 
Top