Nowadays we should use SSL even on websites without any shop or forms. Google doesn’t like pages without SSL. We can enable this protocol in WordPress – it’s a quite easy process.

Enable SSL

Go to Settings -> General and enter your website URL address with https in these two fields.

Now you have SSL enabled on your website. We should now avoid events when the user can access your website using http://example.com and https://example.com. Add this code to your .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
</IfModule>

Of course, you need to change example.com to your domain name. Now you will be automatically redirected to SSL even if you enter URL with http.

Force SSL on the backend

I recommend forcing SSL on the backend. You can do that by adding code to wp-config.php file:

define('FORCE_SSL_ADMIN', true);

just before this line:

/* That's all, stop editing! Happy blogging. */

That’s it. Have fun 🙂

Share this post

Leave a Reply

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