Forcing a HTTPS redirect in cPanel

Overview:

Avoid security warnings when accessing your site with an SSL certificate and forced HTTPS redirect.

Prerequisites:

Ensure you have a valid SSL installed on your cPanel services. If you do not have one, you can use cPanel's AutoSSL service by following this guide


Method

  1. Log into your cPanel hosting service.

  2. Navigate to the "Domains" tool.

  3. Toggle the “Force HTTPS Redirect” option to on for any domains with an SSL installed.

  4. This change should be immediate.  To test, clear your browser cache and open your website,  ensuring you specify HTTP://.  The URL will automatically be redirected to the HTTPS:// version of the URL.

Manual Method

If you have any issues with the above method, you can manually create the redirect by adding the following code to the top of your ".htaccess " file:

# START HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# END HTTPS

Editing your ".htaccess" file:

  1. Log into your cPanel hosting service.

  2. Navigate to the "File Manager" tool, which is under "Files".

  3. Navigate to the "public_html" folder or to the folder where your website is located.

  4. Locate your ".htaccess" file,  right-click on it, then click "Edit".

    1. By default, the ".htaccess" will be hidden - as it is a dot file. To reveal dot files in the File Manager, click "Settings" (top-right), then select “Show Hidden Files”, and then save this.

    2. If the file doesn’t exist, click the "+ File" button to the top-left of the page, then create one of the same name.

  5. Paste the above code at the top of the file on its own lines.


Can't find what you're looking for?

Create or manage support tickets directly with Micron21

You will need to register a new account if this is the first time lodging a ticket.

If you have previous lodged a ticket either online, email or over the phone you will already have an account. Please reset your password, if you have not logged into the support portal before.

Lodge a ticket Manage existing tickets

Need to send us information securely? Use our Escrow service here

Need more advanced support?

Micron21 provides a comprehensive approach to customer care that starts with a base 24/7 support that is included free with every service we offer - there are no charges to enjoy a basic level of support with Micron21 and you are not restricted in how you contact us to receive assistance any time of day or night.

For those who require more advanced support though, our Customer Care plans and Ad-Hoc support are designed to completely remove the complexity of IT management - from taking full responsibility for your entire infrastructure or tailoring a custom approach, we have the capability and know-how.

 

If you've organised remote assistance from Micron21, click here to connect

Sign up for the Micron21 Newsletter