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!

HTTPS Subdomain - redirect HTTP to HTTPS

Discussion in 'General Discussion' started by maricksville, Jun 24, 2012.

  1. maricksville

    maricksville Registered

    Sep 2, 2010
    Likes Received:
    Trophy Points:
    I recently installed an SSL certificate on a subdomain following the steps at cPanel. Lets just say the domain is and the subdomain is

    1. I updated the userdata file for the subdomain and changed the IP address to the IP I wanted to use
    2. I updated the zone file and changed the IP for the A Name for the subdomain to the IP I wanted to use
    3. Using domain tools I checked that resolved to the new IP which it does.
    4. I then installed an SSL certificate on and then on

    When I visit I get the default Apache account screen, and when I visit I get the cPanel 404 page. If however I enter (the location of my admin section) the page loads and I can login.

    I thought that this might be a propagation issue however as the subdomain resolves to the IP and I can reach the admin page I suspect it is not a propagation issue and possibly an incorrect zone file.

    I can now access the site via HTTPS but HTTP returns 404 errors or the default Apache page.

    I have tried htaccess redirect using:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    But this does not redirect to Same Apache message as previous.

    Using the 301 redirection in cPanel does not redirect either.
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst Staff Member

    Oct 2, 2010
    Likes Received:
    Trophy Points:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Could you check the /var/cpanel/userdata/username/ and subdomain.domain.com_SSL files? Ensure the paths are all correct for each file. Ensure the IP is correct for each file.

    If it isn't and you revise anything, then make a backup of httpd.conf after fixing the file(s), rebuild httpd.conf and restart Apache:

    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak120628
    /etc/init.d/httpd restart
    Also, check that the DNS zone is properly setup. You said it was, but doesn't hurt to check it in WHM > DNS Functions > Edit a DNS Zone area.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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