Move from HTTP to HTTPS - WordPress Tips, Tricks Every Serious Blogger Must Know

 


Move from HTTP to HTTPS - WordPress Tips, Tricks Every Serious Blogger Must Know


Move from HTTP to HTTPS


Before you start doing this, make sure you already have HTTPS or SSL (certificates) installed and ready for use on your website. If you have that all set up and the only thing you need to do to set it up for your website, then here’s what you need to do:

Go to Settings General and then update your URL to use the https protocol. After editing it, click Save.


Next, update your .htaccess file and add the following lines:

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

Then, edit your wp-config.php file and add the following line:

define('FORCE_SSL_ADMIN', true);

Finally, you need to update your database to reflect the change in the URL. Not doing so will result in a mixed content warning for your website. While you can do this manually, there is a plugin that makes it easier: Better Search and Replace.

Install this plugin then go to Tools Better Search and Replace.

In the Search for field, put your old URL without https, for example, http://www.yourwebsite.com (#1) and then in the “Replace with” field, put your new URL with https, like https://www.yourwebsite.com (#2). Then, select all tables (#3) to ensure you miss nothing.

Uncheck the Run as dry run? (#4) option and finally, click the Run Search/Replace (#5) option.



Previous Post Next Post

 

Advertisement