Do you have a valid SSL certificate installed and you're wondering why your website is still marked as insecure?
This occurs because most browsers by default request websites over HTTP protocol (rather than a secure HTTPS protocol). To ensure your website is served over a secure connection, you need to implement a force redirect so all traffic is redirected from HTTP to HTTPS.
This guide will teach you how to implement a force HTTPS redirect so all traffic visits your site over a secure connection.
This article is for users who prefer using the cPanel, we have another guide for Terminal users who prefer to make these changes using CLI.
Please ensure you have the following requirements:
- A valid SSL certificate - Your website must have a active SSL certificate, if you don't have a SSL certificate installed, please follow our guide on how to install a Let’s Encrypt certificate before proceeding.
- Your cPanel login details - These were included in the original Welcome to Serversaurus or IMPORTANT: Hosting Documentation email which you should be able to find in your inbox otherwise follow these instructions on how to update your cPanel password.
Let's get started!
- Login to cPanel
- Using the search bar, locate the File Manager function
- Navigate to Settings in the left hand corner, ensure Show Hidden Files (dotfiles) is enabled and save changes:
- Select public_html from the list of directories:
- Locate a file named .htaccess, if this file is not present, create the file. If you have a .htaccess as a precautionary measure copy the .htaccess and name the duplicate file .htaccessold.
- Using the Edit option, add the below entry to the beginning of your .htaccess file. Your .htaccess may already have line 1 & 2 present, in which case just add line 3 & 4 and save your changes:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Comments
0 comments
Please sign in to leave a comment.