Created
October 30, 2021 20:57
-
-
Save aydinjavadly/ca8f3fb72aa2de881fd753d52e280f32 to your computer and use it in GitHub Desktop.
WordPress - Setup SSL. Prefer SSL usage for admin area.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* File: wp-config.php | |
* | |
* 1. Prefer SSL usage for admin area | |
* 2. Check for https existence | |
* | |
*/ | |
/** wp-config.php / Prefer SSL usage for admin area */ | |
define( 'FORCE_SSL_ADMIN', true ); | |
/** wp-config.php / Check for https existence */ | |
// in some setups HTTP_X_FORWARDED_PROTO might contain | |
// a comma-separated list e.g. http,https | |
// so check for https existence | |
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) | |
$_SERVER['HTTPS']='on'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment