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!

only secure "https://" possible?

Discussion in 'General Discussion' started by basic, Apr 22, 2009.

  1. basic

    basic Active Member

    Joined:
    Nov 10, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    156
    Hello All:

    A simple question:
    Is it possible (in WHM) to set a domain hosting account up, so that it is ONLY accessible via https://.... and not http://... Someone trying to access http://domain.com would then be forwarded to https://domain.com -- is that possible, can this be set up? If so, how?

    Thanks for your input.


    John
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You could set up a redirect rule to direct traffic going to http:// to go to https://. This can be done by using mod_rewrite directives in .htaccess. You can find information on how to do this at:

    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
     
  3. basic

    basic Active Member

    Joined:
    Nov 10, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    156
    Thanks!

    To anyone else interested -- this works:

    I edited the .htaccess file of the domain and added these three lines:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. PlatinumServerM

    PlatinumServerM Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2005
    Messages:
    400
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    New Jersey, USA
    cPanel Access Level:
    Root Administrator
    You can also use the following

    RewriteEngine On
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*) https://yourdomainhere/ [R]
     
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