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.

SSL Redirect

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

  1. grayloon

    grayloon Well-Known Member

    Joined:
    Oct 31, 2007
    Messages:
    98
    Likes Received:
    2
    Trophy Points:
    8
    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:
    16
    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}
     
Loading...

Share This Page