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

Discussion in 'Bug Reports' started by allewreK, Jun 3, 2014.

  1. allewreK

    allewreK New Member

    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.
     
  2. mistwang

    mistwang LiteSpeed Staff

    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.
     
    allewreK likes this.
  3. allewreK

    allewreK New Member

    Ok, that's great thanks ! Hope to see it soon.
     
  4. Luciano Passuello

    Luciano Passuello New Member

    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: May 17, 2015
  5. NiteWave

    NiteWave Administrator

    the answer is Yes. you can upgrade to 5.0 to see if it meets your requirement 100%.
     
  6. Luciano Passuello

    Luciano Passuello New Member

    Hello, I upgraded to 5.0.x and variables are still not parsed for me. :(
    Is there a specific setting or configuration to enable this feature?
     
  7. mistwang

    mistwang LiteSpeed Staff

    Please post your header directive.
     
  8. Luciano Passuello

    Luciano Passuello New Member

    Here's the relevant .htaccess section:

    <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:
    Link: <http://mysite.com/myresource.html>; rel=\"canonical\"


    LSWS 5.x outputs this header directive:
    Link: <%{CANONICAL}e>; rel=\"canonical\"





     

Share This Page