WordPress HTTP to HTTPS Auto Redirect

As of the beginning of July 2018 Google started forcing site owners to use the HTTPS encryption by flagging non HTTPS sites as “Not secure” when browsed with Google Chrome(v. 68). This alone is a great motive to start converting your HTTP setup into an HTTPS one. In the past, this would cost you a bit but now you can use LetsEncrypt certs for free. Of course, you still need to set up the SSL inside your WordPress site, we’re going to create a simple guide about this so make sure you follow our upcoming posts and tutorials.

When your site works under https there is one final step to make sure your old and new visitors are using it instead of the HTTP one. That is to set up an htaccess redirect so that anyone who visits the no https version of your WordPress site(for example http://bitofwp.com) will be sent to the https one.
In order to do this go on and edit your htaccess file using your file manager editor or your HTML editor and add the following line at the end:

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

Then save the file and check if your site HTTP version redirects to the https one.


If you don’t have the time or the desire to start editing some of your core site files like .htaccess you can take a look at our WordPress HTTP to HTTPS migration service where we will set up your SSL, audit your WordPress website and convert your HTTP to HTTPS for $30 per site.

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *