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!

How to Redirect to SSL Properly

Discussion in 'General Discussion' started by Drumrocker365, Apr 17, 2014.

  1. Drumrocker365

    Drumrocker365 Well-Known Member

    Joined:
    Apr 15, 2014
    Messages:
    72
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hey there,

    I was wondering how I can use cPanel to make http:// automatically redirect to https://. For example, if someone enters http://billing.domain.net, they'll be redirected to https://billing.domain.net. Basically wanting a way to force https://.

    Thanks,
    Christian
     
  2. Drumrocker365

    Drumrocker365 Well-Known Member

    Joined:
    Apr 15, 2014
    Messages:
    72
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I have later discovered that you just need to add this simple code to your .htaccess file:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    You can try using the following rule in your .htaccess file within the public_html directory:

    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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