What do I need to do to convert my MultiSite from HTTP to HTTPS?

I’ve been tasked with converting about 100 sites in my multisite instance to HTTPS.

I can easily write a script to hit the DB and change the siteurl and home values to HTTPS, which inturn should force the site to enqueue scripts and future embeded images to HTTPS right?

Well I’ll also need to go through all post_content for any internal links, as well as images using HTTP and convert those to HTTPS.

I could probably whip something together to do that, but Im wondering what else I need to change. GUIDs right? If I used the $wpdb commands would I need to reserialize the DB afterwards?

I should have ask first, is there a reliable plugin that will take care of this for me? What else do I need to know about this process?

Notes
– We already have all the SSL certs so thats something I dont have to worry about.
– Server is running linux(redhat) and apache
– The multisite is using sub directories
– I dont know much else tho, the server is outside my jurisdiction

5 s
5

You could run a script to UPDATE all urls and guids to https, if you want a clean setup.

But also consider alternatives such as:

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

In wp-config.php for the backend:

define('FORCE_SSL_ADMIN', true);

In wp-config.php for the frontend (or run a db UPDATE script):

define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');

Then you could simply run a script to UPDATE all wp_posts content url.

Leave a Comment