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.

[End-Users] Force SSL: Read, please

Discussion in 'General Discussion' started by Sparky2002b, Mar 8, 2007.

  1. Sparky2002b

    Sparky2002b Registered

    Joined:
    Apr 23, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Right, so, a few of my users have installed E-Commerce scripts and have SSL certificates; and I have WHM Autopilot.

    I'd like to HTTPS:// these directories and/or subdomains.

    Is this possible? How?

    Thanks.
     
  2. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    16
    Inside of the directory that you want to be secure, you can edit .htaccess to make sure any http requests are directed to https automatically and without much fan fare.

    vi .htaccess

    ------- copy and paste the code below into the .htaccess file -----

    ### Redirect to ssl
    RewriteCond %{HTTPS} !=on
    RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

    ----------------- end copy/paste --------------
     
  3. martinoo

    martinoo Registered

    Joined:
    Mar 27, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    Where should this code be entered within the .htaccess file?
    I put it at the end but it does not redirect users from http to https
     
  4. critter

    critter Well-Known Member

    Joined:
    Nov 19, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Amarillo, Texas
    hmm ... I tried it too, doesn't seem to work :-(
     
  5. critter

    critter Well-Known Member

    Joined:
    Nov 19, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Amarillo, Texas
    OK found this one in another post, works great.

    RewriteEngine On
    RewriteCond %{SERVER_PORT} !443
    RewriteRule ^(.*)$ https://YOUR_DOMAIN/$1 [R,L]
     

Share This Page