This website uses cookies for some functions to work. Click here to read our privacy policy and learn about our use of cookies.
pCloud Encrypted Cloud Storage

How to Configure Let’s Encrypt SSL with WordPress

Step 3: Redirecting All Traffic to HTTPS

You obtained a free SSL cert, configured it with WordPress. But your old links are still active out there. They used to begin with HTTP. Of course you won’t be able to change those backlinks on third-party sites.

Even if your site is new and doesn’t have any backlinks, you still don’t want your site to be browsed over HTTP. This is why, you will redirect all HTTP traffic to HTTPS version of your WordPress site.

There are two options to do this. You can either manually edit the .htaccess file in cPanel or use a plugin. I prefer to do this manually but you can use Really Simple SSL plugin to do the redirection automatically for you.

If you don’t want to add the weight of a new plugin, you will have to go back to cPanel and open File Manager. Go to the installation directory of your site (with Show hidden files option enabled) and find .htaccess file.

If you can’t find .htaccess file, you will need to create one.

The .htaccess File Shown in cPanel

Now right click on .htaccess file and select Edit. Copy and paste the following text in the file and save it.

Caution: If .htaccess file already existed, then make sure it doesn’t already contain the RewriteEngine On string. If it does, then omit RewriteEngine On from the following text, copy rest of the text and paste it right below RewriteEngine On in .htaccess file.

Copy This Code
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Your .htaccess file should look like this after you make changes.

Forwarding HTTP traffic to HTTPS Using .htaccess

After you save this change, all HTTP requests to your domain will be automatically redirected to HTTPS version. How cool is that!

Step 4: Add HTTPS Version to Google Webmaster and Analytics

For you and your visitors, your HTTP and HTTPS sites are same. For Google however, they both are different sites. This is why you will need to add the HTTPS version of your site to Google Webmaster Tools (now known as Google Search Console) and Google Analytics.

For this, log-in to Google Webmaster and click Add Property. Enter your site URL with HTTPS. For example, enter https://mycoolblog.com and save changes. From now on, you will see both HTTP and HTTPS version of your site under Google Webmaster dashboard.

Adding New Property in Google Webmaster Tools

To make changes in Google Analytics, select your property and change Default URL field to HTTPS from HTTP. Save changes and you’re done.

Changing Default URL in Google Analytics

Fixing Mixed Content Warning

After you configure SSL with your WordPress site, you might receive Mixed Content warning in your browser. This warning is the result of some elements of your page not being served over SSL. Make sure to change path of images and scripts served over HTTP.

If you use third-party plugins, it is possible they are not serving content over HTTPS. To make things easier, install either SSL Insecure Content Fixer or Really Simple SSL plugin.

Configure Let’s Encrypt SSL with WordPress: Summing Up

OMG, look at that! You just configured a free SSL certificate from Let’s Encrypt to work with WordPress! All your traffic is now redirected to HTTPS version of your site, and you also notified Google about this change.

So what next, you may ask? Well, enjoy your encrypted site.

This is it folks. This was Parvez and you were reading How to Configure Let’s Encrypt SSL with WordPress on techstuffer.com. If you found this guide helpful, share it with others.

If you have any questions, feel free to ask. Also let me know if this guide can be improved or of there are other ways of achieving this.

Until we meet next, happy blogging!

Support Me: If this article/tutorial helped you today, please consider supporting me and help me run frunction.com