[Resolved] .htaccess problem under LiteSpeed, not parsing variables in 'Header set link' instruction

Status
Not open for further replies.
#1
If you add that kind of instrutctions in .htaccess :

Code:
Header set Link '<http://%{HTTP_HOST}e%{REQUEST_URI}e>; rel="canonical"'
Variables are not parsed.

If I disable Apache, variables are parsed.

Best regards.
 

mistwang

LiteSpeed Staff
#2
LiteSpeed does not support using variables in "Header" directive yet, we add that feature to our to do list. I will be implemented in our 4.2.x or in 5.0 release.
 
#4
Sorry to ressurect an old thread, but I am in the need of this same feature.
Since 5.0 is out, does LSWS now support setting variables in header directive?
 
Last edited:
#8
Here's the relevant .htaccess section:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule .* - [E=CANONICAL:http://mysite.com%{REQUEST_URI},NE]
  RewriteCond %{HTTPS} =on
  RewriteRule .* - [E=CANONICAL:https://mysite.com%{REQUEST_URI},NE]
</IfModule>
<IfModule mod_headers.c>
  Header set Link "<%{CANONICAL}e>; rel=\"canonical\""
</IfModule>

Apache 2.4 outputs this header directive:
Code:
Link: <http://mysite.com/myresource.html>; rel=\"canonical\"
LSWS 5.x outputs this header directive:
Code:
Link: <%{CANONICAL}e>; rel=\"canonical\"




 
Last edited by a moderator:

mistwang

LiteSpeed Staff
#9
Please try latest build of 5.0, should work now.
Code:
/usr/local/lsws/admin/misc/lsup.sh -f -v 5.0
 
Last edited by a moderator:
Status
Not open for further replies.
Top