Skip to content

Instantly share code, notes, and snippets.

@wgroenewold
Last active February 8, 2024 10:51
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wgroenewold/68fcaaabfbf939282b1a5cddd6f636e8 to your computer and use it in GitHub Desktop.
Save wgroenewold/68fcaaabfbf939282b1a5cddd6f636e8 to your computer and use it in GitHub Desktop.
Force all traffic for Wordpress over SSL
define('FORCE_SSL_ADMIN', true);
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
$_SERVER['HTTPS']='on';
}
@wgroenewold
Copy link
Author

Updated with isset so WPCLI doesn't complain

@jmslbam
Copy link

jmslbam commented Mar 15, 2021

Dank je Wouter ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment