HTTPS not working (assets pointing to HTTP)

Hello,

Tried looking on forum for answer…

Have previously got the site trusted. All assets trying to load while on https and therefore not loading. Get mixed content errors as insecure…

In Settings > General the WP address and site urls are greyed out so cannot amend the http:// there

Didn’t want to poke around too much in the code if there was a simple solution. Any ideas appreciated.

Elliot

Issue is somewhat different to how I first described.

I have the home and site_url defined in wp-config:

’ define(‘WP_HOME’, ‘https://’ . $server_name );
define(‘WP_SITEURL’, ‘https://’ . $server_name );

But I get too many redirects. I don’t get this if change back to http… any ideas?

I have a solution.

I added the following to my wp-config file:

    /* Inserted by Local by Flywheel. See: http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy */
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
	$_SERVER['HTTPS'] = 'on';
}
2 Likes

Glad you got it! Sorry you had to fish around for that solution!

That should’ve been automatically inserted. Was this an older Local site by chance?

I was using 2.1 and tried 2.2 but not added automatically.

I do have a fairly custom wp-config to let me use one remote database for local and staging… Not sure if that is related.

Perhaps a check for this in the local dashboard?

Cheers!

It may’ve not been added since it looks for /* That's all, stop editing! Happy blogging. */ and adds it above that line.

Is that line not in your wp-config.php file?

Yep, that is there…

I had the same issue. Adding the code snippet raison posted fixed it.

Did that fix your issue Jeremiah?

I will make note of this issue, as this seems to keep reoccurring.

Which version of Local were you using, if you don’t mind me asking?

Thanks,
Chris :slight_smile:

FYI just happened for me with a new WP install from version 2.2.1