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!

SSL Redirect

Discussion in 'General Discussion' started by grayloon, Jun 28, 2010.

  1. grayloon

    grayloon Well-Known Member

    Joined:
    Oct 31, 2007
    Messages:
    107
    Likes Received:
    2
    Trophy Points:
    68
    Location:
    Evansville, IN
    cPanel Access Level:
    Root Administrator
    Twitter:
    I have a single account with a mix of secure and insecure web content. This account uses the following subdomains:

    www.domain.com (HTTP)
    secure.domain.com (HTTPS)

    If I hit HTTP://secure.domain.com, I get the cPanel Great Success page. How can I force all traffic to this subdomain to use HTTPS?
     
  2. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    166
    cPanel Access Level:
    DataCenter Provider
    You can use the cPanel "Redirect" feature or else you can write your own RedirectMatch rule and place it in the .htaccess file. For the latter, something like the following can be used (caveat emptor: I have not tested):

    Code:
    RewriteCond %{HTTP_HOST} !^secure.domain.com$
    RewriteCond %{HTTPS} Off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
     
    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