HTTP to HTTPS redirect

HTTP to HTTPS redirect

So, you’ve got your new SSL installed, but when you browse to your site it still says Not Secure in the address bar. That’s because you need to redirect your site to load over https to utilize that SSL.

This can normally be achieved in a few different ways; through the platform, adding a redirect in the .htaccess file, changing the core URL or by using a WordPress plugin.

Option 1 – through the platform

Log in to the platform and select the website from the dashboard. Select the Aliases and Redirects page from the site menu and change the top toggle for HTTPS redirect.

Option 2 – the .htaccess redirect

The .htaccess file lives in the site’s document root folder and is full of instructions which let the server know how to behave/react in different situations and has an affect on how your website works. Therefore, remember to create a backup of the file to revert to if everything goes wrong!

There are several ways you can edit the file; FTP, SSH or sometimes through your control panel. Pick your favourite way and open the file. The text that you need to add is:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Option 3 – the core URL change

Log in to WordPress and go to Settings>General and update both the WordPress Address (URL and Site Address (URL) to start ‘https’ and then save the changes. Just so you know, once you’ve done this WordPress will log you out. Log back in and next you need to pop some info in to your .htaccess file to set up those redirects:

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

Option 4 – the WordPress plugin

There are many plugins out there that can do this for you; Easy HTTPS Redirection, Force HTTPS, Really Simple SSL to name a few. Best bet is to Google it and see which one fits your set up best.

Please note that Nimbus Hosting offer this article for advice only, changes to your web application should be done in a controlled environment with consultation with your development team. Further information on the advice can be found on the links below.

https://www.wpbeginner.com/wp-tutorials/how-to-add-ssl-and-https-in-wordpress/

https://websitesetup.org/http-to-https-wordpress/