Few month ago i wrote how to integrate Cloudflare SSL to your WordPress website.
We used some little tricks in wp-config and Apache Configuration and Cloudflare SSL began working like pure SSL.
Now i am sharing another little trick which doesn’t require apache or nginx settings change.
This file contains hidden or 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 | |
/** | |
* The base configuration for WordPress | |
* ... | |
* @package WordPress | |
*/ | |
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) | |
$_SERVER['HTTPS']='on'; | |
if ( $_SERVER['HTTPS']!='on') { | |
header('location: https://YOUR_DOMAIN_HERE'. | |
$_SERVER["REQUEST_URI"]); | |
exit; | |
} | |
define('FORCE_SSL_ADMIN', true); | |
//..... rest wp-config lines here |
Discover more from WP DEV - Elvin Haci
Subscribe to get the latest posts sent to your email.