wp_guess_url working without SSL, in turn $_SERVER[‘HTTPS’] = ‘on’; in wp-config

A few days ago I try it asking this question here, but then I got minus points, this is very much wordpress issue:
I launch a multisite and using this in my wp-config.php:
if (isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’)
$_SERVER[‘HTTPS’] = ‘on’;

Everything is okay, but when a user create a new site, of this new site’s has default Siteurl and Home settings with http:// … So I need manually rewrite these options in network_home/wp-admin/network/site-settings.php.

The Siteurl and Home belongs to this by option reference:

home:

Blog address (URL)
Default: wp_guess_url()
Data type: String (URI)
and

siteurl:

WordPress address (URL)
Default: wp_guess_url()
Data type: String (URI)

So causing the problem In both cases, that wp_guess_url() continue to using http:// … How can I change that, to use it default https:// on new sites?

Read more here:: wp_guess_url working without SSL, in turn $_SERVER[‘HTTPS’] = ‘on’; in wp-config

Leave a Reply

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