WordPress Redirect to HTTPS

So you’ve installed an SSL certificate on your server, and now you need to configure WordPress to use HTTPS. Don’t sweat! Below, we’ll explain the process step-by-step.

These instructions assume you’re using Apache as your Web Server. If you’re using Nginx instead, follow this guide instead.

Grab a nice cup of coffee or tea, and we’ll jump in. Ready? Okay!

There are two important steps involved to set your WordPress redirect to HTTPS. We’ll have to tell both WordPress and Apache about the change:

Steps to Configure HTTPS:

Configure WordPress:

First, navigate to http://yoursite.com/wp-admin and log into your admin account.

From there, click on Settings > General

In the WordPress Address (URL) field, change the HTTP to HTTPS. You’ll also want to change HTTP to HTTPS in the Site Address (URL) field:

Wordpress Redirect to HTTPS

Saving your changes, WordPress now knows that we want to use HTTPS for the site. In the next section, we’ll cover how to make sure that Apache knows to use HTTPS as well.

Configure Apache:

In This step, we need to make sure that Apache knows to redirect requests made to HTTP, to HTTPS instead.

To do this, you’ll want to edit the file .htaccess in the root directory of your WordPress install. If this file doesn’t exist, create it and then open it.

Some FTP editors have a tough time with editing .htaccess because the name begins with a period – I’ve found that downloading the file, editing, and then uploading works if direct editing does not.

Once you’ve opened your .htaccess, Add the following:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

And save the file. Upload it, if needed. You won’t need to restart the web server, but you may have to do a hard-refresh on the website (ctrl + F5) or a cache clear to see the change take effect.

Congratulations! You’ve successfully configured WordPress to redirect to HTTPS.

Thanks for reading! If you found these instructions helpful, consider commenting below to let us know.

Leave a comment

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