Migrate WordPress from HTTP to HTTPS (SSL/TLS)

Tiempo de lectura: 3 minutos

Hello, today we are going to learn how we can migrate our WordPress site from HTTP to a secure HTTPS version under the TLS/SSL protocol.

The first thing we are going to do is to install this plugin that will allow us to replace internal links from HTTP to HTTPS:

Search for search & replace (https://es.wordpress.org/plugins/search-and-replace/)

And install it.

Another one I recommend installing is this: (https://es.wordpress.org/plugins/better-search-replace/)

Now let’s go to Tools > Search & Replace

I recommend making a backup of the database:

Now let’s Replace Domain URL:

And we have to indicate the URLs, we indicate the current URL and the new one:

We click on replace domain/URL

Once finished it appears:

We click on download SQL file, as it contains the Database with the changes made.

And now we import it, we go to Import SQL, select our new file and click on Import SQL file:

Now we need to go to our WordPress administration and change the URL addresses:

Go to Settings > General

Now go to WordPress Address (URL) and Site Address (URL)

And change it to HTTPS:

Now we need to add the following to the .htaccess file:

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

And now it’s important that in our environment SSL is activated, for that I have some tutorials around here: https://devcodelight.com/crear-un-docker-compose-con-php-nginx-mysql-mariadb-nginx-proxy-manager-para-certificados-ssl-https/ or https://devcodelight.com/certificados-ssl-lets-encrypt-en-docker-usando-nginx-proxy-manager/

Leave a Comment