my host has different folders for http and https! i am not sure how to make them work together either. 🙂
Thread Starter
Anonymous
To give more detail, the fix for cookies so that logins work for an https:// site is:
Change the following line in wp-includes/vars.php from:
define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );
To:
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );
(from mcnicold)
I have found that to do belown in file wp_login.php can solve my problem .
Change this:
if ( dirname(‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]) != get_settings(‘siteurl’) )
update_option(‘siteurl’, dirname(‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]) );
to that:
if(isset($_SERVER[‘HTTPS’]))
$server_protol=”https://”;
else
$server_protol=”http://”;
if ( dirname($server_protol . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘SCRIPT_NAME’]) != get_settings(‘siteurl’) )
update_option(‘siteurl’, $server_protol . $_SERVER[‘HTTP_HOST’] . dirname( $_SERVER[‘SCRIPT_NAME’]) );