The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HSTS header creates a ERR_TOO_MANY_REDIRECTS error

Discussion in 'General Discussion' started by Erik Ellsinger, Sep 29, 2015.

  1. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    I've added this HSTS header to the domain example.me:
    Code:
    <IfModule mod_headers.c>
    Header always set Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
    </IfModule>
    
    (my .htaccess file contains nothing more)

    But when I try to go to example.me in Chrome I get this error message:

    ERR_TOO_MANY_REDIRECTS

    In the Apache error log I get this:

    Too many arguments to directive

    I've searched for the correct way of adding a HSTS header if I want to be able to use preload (hstspreload.appspot.com/) and from what I can find my HSTS header is correct. Anyone know what the problem is?
     
    #1 Erik Ellsinger, Sep 29, 2015
    Last edited by a moderator: Jan 14, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Are there any additional .htaccess files in the account's home directory (above the public_html directory) that could contain additional redirects?

    Thank you.
     
  3. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    I found the problem, this is how it should look:

    Header always set Strict-Transport-Security: "max-age=31536000; includeSubdomains; preload"
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. tmyrdal

    tmyrdal Registered

    Joined:
    Feb 4, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Where do you sett that settings ?
     
  6. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    In the htaccess file of the site in question.
     
Loading...

Share This Page