Skip to content

Instantly share code, notes, and snippets.

@ahmed-abdelazim
Last active March 26, 2019 16:56
Show Gist options
  • Select an option

  • Save ahmed-abdelazim/953f2f71f2447037f5f7ed20f78310e0 to your computer and use it in GitHub Desktop.

Select an option

Save ahmed-abdelazim/953f2f71f2447037f5f7ed20f78310e0 to your computer and use it in GitHub Desktop.
Fix HTTPS WordPress login to the admin panel redirect loop
<?php
// add these lines on the top of the file wp-config.php
define('WP_SITEURL', 'https://aasmouha.com');
define('WP_HOME', 'https://aasmouha.com');
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
if( isset($_SERVER['HTTP_CF_VISITOR']) && strpos($_SERVER['HTTP_CF_VISITOR'], 'https') )
$_SERVER['HTTPS']='on';
php?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment