1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Server Configuration and Hosting' started by allewreK, Jun 1, 2014.

  1. allewreK

    allewreK Active Member


    I have a quite strange problem with LiteSpeed (CentOS).

    I would like to canonicalize some pages, so I added that to my htaccess :

    Header set Link '<http://%{HTTP_HOST}e%{REQUEST_URI}e>; rel="canonical"'
    The problem is that when I check my headers, I'm receiving the exact same string as above :
    That means that my web server is not parsing my variables in this instruction.

    • In the same .htaccess files, all my Rewrite rules are working fines, with variables.
    • I tried the same instruction under apache2 localhost and it's working.

    Best regards;

    cc @Slavik , @lsmichael
  2. Adam Howard

    Adam Howard Well-Known Member

    If you're using Open LiteSpeed, you should know that it does not read htaccess. Your rewrite rules and other values need to be imported into the config (you can do so via Open LiteSpeed's control panel).
  3. allewreK

    allewreK Active Member

    Hello Adam, thanks for the reply,

    I'm using LiteSpeed 4CPUs Entreprise LiteSpeed, I'm sure it's reading my .htaccess file since it's correctly redirecting + I'm receiving the variables in headers, but as pure string, not parsed as variables.
    Adam Howard likes this.
  4. Adam Howard

    Adam Howard Well-Known Member

    Alright. Wanted to be sure (a lot of people simply say, LiteSpeed and never know the difference).

    I've never used the full enterprise edition. Sorry I don't know what you're doing wrong

    @Slavik , @lsmichael
  5. allewreK

    allewreK Active Member

    I checked again and again, it looks like you can't add variables in the "Header" directive under LiteSpeed :mad:
    Adam Howard likes this.
  6. Adam Howard

    Adam Howard Well-Known Member

    Well that really sucks.... That's kind of an important feature to be leaving out.

    Did you double check on LiteSpeed's support forums?
  7. allewreK

    allewreK Active Member

    Yes I did :(
    Adam Howard likes this.
  8. Slavik

    Slavik XenForo Moderator Staff Member

    I'll poke Michael soon as I see him online to see what can be done :)
    Adam Howard likes this.
  9. allewreK

    allewreK Active Member

    Thanks you very much Slavik, I really need that thing to set up a CDN...
    Adam Howard likes this.
  10. lsmichael

    lsmichael Member

    Sorry for the delay. @allewreK did the right thing and posted the question to our forum. Turns out we don't support using variables in a Header directive yet. The developer says it will be worked into a future release. (Probably 4.2.x, but it might have to wait for 5.0.)

    Thanks for asking @allewreK !
    allewreK likes this.
  11. allewreK

    allewreK Active Member

    Amazing, thanks you very much, can't wait to see it released lol ;)

Share This Page