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!

Switching from http to https

Discussion in 'Security' started by Website User, Jul 20, 2018.

  1. Website User

    Website User Registered

    Joined:
    Jul 20, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Utah
    cPanel Access Level:
    Website Owner
    I have having difficulty in switch from http to https on my Web sites. Here's the issue. For your information, I have access to WHM and to cPael for all my domains.

    I created I ran Auto SSL within WHM for a particular domain, and now the domain loads in a Web browser as both http and https, but I only want it to point to https.

    I then went in and created an .htaccess file with this code to create a 301 redirect.

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

    However, when I did this, the https version either times out or loads extremely slowly as it it is searching for the correct address or key.

    In one of the error logs, it had this message:

    [ssl:error] [pid 996] (EAI 2) Name or service not known . . . could not resolve address of OCSP responder

    Also, within the SSL / TLS Status settings for that account, it had an error message like this:

    "The system failed to fetch the DCV file . . . The system failed to send at http "get" request to..." and so forth.

    When I hit the Run AutoSSL, the error message disappeared. However, this was after I removed the redirect, so I'm wondering if the issue has something to do with the way I created the redirect, or other.

    Any suggestions are appreciated.
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,204
    Likes Received:
    228
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Website User

    The AutoSSL DCV check requires the ability to perform a curl request over http - the forced redirect to https gets in the way of this process. With v74 of cPanel, we're introducing a DNS validation fallback for instances like this where the httpd DCV check fails. In your situation, it may be easiest for v74 which is in EDGE right now though I believe we will be moving it to CURRENT soon.

    If you want you can create an exception as well. Force everything to https except specific URL's. For example, what's detailed here: https://stackoverflow.com/questions/26426893/htaccess-redirect-to-https-except-a-few-urls

    your URL would be something like:

    http://yourdomain.tld/.well-known/pki-validation/

    The documentation on mod_rewrite from apache may also be useful https://stackoverflow.com/questions/26426893/htaccess-redirect-to-https-except-a-few-urls


    Thanks!
     
    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