A strong HTTPS connection makes your website or blog secure. Also, according to Google, HTPPS secure sites rank better than the regular HTTP connections. For SEO purposes, now HTTPS connections are a ranking parameter. So you have many advantages of installing a SSL certificate in your website like it provides credibility and trust for the users, your website becomes secure and it is great for SEO.
Today, I will guide you with simple steps on how you can install a free SSL certificate on your WordPress website or blog or any other kind of website. All you need is a cPanel access. Remember, free SSL certificates expire after 3 months. So you need to repeat this procedure every 3 months. Alternatively, you can buy a SSL certificate to enable HTPPS connection.
Installing free SSL certificate requires 3 steps: Generate a free SSL certificate for your website, Install SSL certificates files in cPanel and Enable Automatic redirect by using .htaccess file.
Step-1: Generate a free SSL certificate for your website
1) Go to SSL for Free and enter your website address in the field where you want to install the SSL certificate.
2) Click on Create Free SSL Certificate button.
3) Now, you have to verify that this is your own domain. There are 3 options: Automatic FTP verification, Manual verification and Manual verification using DNS.
I will use the Manual verification by uploading a file on my website.
Click on Manually Verify Domain button.
You will be given 2 files to download and upload it in your domain. Download these files.
You will have to create 2 folders in your root directory: .well-known and acme-challenge
Steps to create folders in cPanel and upload the files
Login to your cPanel.
Click on File Manager.
Go to public_html in File Manager.
Create the new folder name as: .well-known and click on Create New Folder button.
Now, inside the .well-known folder, create another folder name: acme-challenge
Inside acme-challenge folder upload the files which you downloaded from SSL for Free by clicking on Upload button in cPanel.
After you have uploaded these files in the acme-challenge folder, go to SSL for Free and visit the links as given in Point 5.
4) Now, click on Download SSL certificate button.
In few minutes, your SSL certificate will be generated.
You will see the SSL certificate files and an option to download these files.
We have successfully finished Step-1: Generate a free SSL certificate for your website.
Now, we have to install these certificate files in cPanel.
Step-2: Install SSL certificates files in cPanel
1) Login to cPanel and click on SSL/TLS under security.
2) Click on Manage SSL sites under Install and Manage SSL for your site (HTTPS).
3) Under Install an SSL Website, select the domain and copy paste the certificate code which you generated in SSL for Free in Certificate: (CRT) field.
Make sure you are copy pasting the entire code which begins from —–BEGIN CERTIFICATE—– and which ends with —–END CERTIFICATE—–
Similarly, copy paste the Private Key (KEY) and Certificate Authority Bundle: (CABUNDLE) which you generated from SSL for Free.
Click on Install Certificate button.
After installation, you will get a message like: You have successfully updated the SSL website’s certificate.
We have successfully finished Step-2: Install SSL certificates files in cPanel.
Now, we have to enable the automatic redirect to HTPPS in the website.
Step-3: Enable Automatic redirect by using .htaccess file
Automatic redirect makes sure that your website is always opened with https connection. For Example, if a user types www.yoursitename.com or yoursitename.com and hits enter on their browser, the website automatically redirects to https://www.yoursitename.com/
To enable automatic redirect to HTTPS follow the below given steps:
1) Login to cPanel and go to File Manager –> public_html
2) If you can’t see the .htaccess file then click on Settings on the top right corner in File Manager.
Check option Show Hidden Files (dotfiles)
Click on Save.
3) Select .htaccess file and click on Edit.
Click on Edit Button.
4) Add the following lines in the .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
It will look like:
Click on Save Changes.
You have successfully finished Step-2: Enable Automatic redirect by using .htaccess file.
If you have followed all the above steps correctly then you have successfully installed SSL certificate in your website.
To verify, go to cPanel –> Security –> SSL/TLS Status
Here, you can see that your certificate is active and when it will expire. When it expires, you can again add a new SSL certificate by method mentioned above.
Also, type in your domain name in the web browser and hit Enter. Like yourdomainname.com and hit Enter.
You will see the green padlock in your address bar for the website which suggests that you have successfully installed the SSL certificate in your site and your website is protected by using HTTPS connection.