Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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 Well-Known Member

    Joined:
    Sep 25, 2015
    Messages:
    51
    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:
    44,277
    Likes Received:
    1,846
    Trophy Points:
    363
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Erik Ellsinger

    Erik Ellsinger Well-Known Member

    Joined:
    Sep 25, 2015
    Messages:
    51
    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:
    44,277
    Likes Received:
    1,846
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I am happy to see you were able to address the issue. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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 Well-Known Member

    Joined:
    Sep 25, 2015
    Messages:
    51
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice