Multi-site: Change the URL of main site to HTTPS

I’ve setup the multisite on a fresh installation of WordPress.

Then I created some other websites, so, in the end, I have something like this

  • http://example.com
  • http://site1.example.com
  • http://site2.example.com
  • http://site3.example.com

I have then installed an SSL digital certificate, so I changed the URLs of the websites to match the HTTPS scheme:

  • http://example.com

To change the scheme I gone to Sites > All Sites, then clicked on each site and in tab “Information” (the first one) I simply changed the scheme and saved.

This worked.

The only site left without the https is http://example.com: for this, in fact, I have cannot change the URL.

If I go to Sites > All Sites and click on it, in fact, in the first tab “Information” the URL is not editable and is in the form http://example.com, without the https scheme.

How can I change it?

I’d like to change it now, before I start to install plugins and write articles.

Any suggestions?

4 Answers
4

I would suggest editing the wp-config.php file, and adding:

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

However for multisite here it says you should edit DOMAIN_CURRENT_SITE and PATH_CURRENT_SITE, if there is such thing defined in a multisite wp-config.

First suggestion is based on this article.

Leave a Comment