Support Forum

Permalink automatically (and erroneously) changing to https://

23 Answers

New Answer

MP Mr Papa
Mr Papa
Member

okay. would like to see the effects of the output from those echo’s next time it changes…

at some point, for some reason, they are thinking the server is https/ssl

PR Propheticus
Propheticus
Member

Yesterday morning I saw it had switched to https again (those lines still echo’d nothing btw). I had no time because I had to leave, so I didn’t ‘fix’ it with the manual backup method. When I returned home that afternoon it had switched back to http on itself again. Since then it has stuck and did not switch to https since. Fixed?

I did:

– Add force ssl false and force admin false statements to wp-config.

– Remove the /wp-content/sp-resources/* from the CDN (content delivery netwrok) and only added the forum-laguage, forum-avatars, and our forum-theme from the sp-resources. Apparently some forum-plugins, like the tinyMCE editor, did not like being hosted on a CDN (which resulted in blank popups when clicking the ‘add image’, ‘add link’ buttons)

– Update the forum to the latest version (today’s release).

PR Propheticus
Propheticus
Member

It did it again today. is_ssl again returned nothing. It appears it’s wordpress’s fault in a way. Apparently WordPress has been developed on/for an IIS server. The function is_ssl is writen in such a way that on an Apache server (like ours) it isn’t always working properly (and the logic in the function means it default to TRUE…explains a lot, doesn’t it?)

 

Fix for people running an APACHE based server:

Change the is_ssl() function in wp-includes/functions.php around lines 3698 – 3708 to:

function is_ssl() {
        if ( isset($_SERVER['HTTPS']) ) {
                #if ( 'on' == strtolower($_SERVER['HTTPS']) )
                        return true;
                #if ( '1' == $_SERVER['HTTPS'] )
                #return true;
        #} elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
        #       return true;
        }
        return false;
}

source: http://wordpress.org/support/topic/ssl-enabled-by-default-for-loginadmin-how-to-remove#post-1262680

After I made this change the permalink changed back to http again.

MP Mr Papa
Mr Papa
Member

actually, its the other way around… wp was developed for apache and *nix…  they have had problems keeping it working on IIS…

I have not had this issue with apache either nor do we have any other reports…

but if you think its a real bug, you should report it to wp at:  http://core.trac.wordpress.org/

PR Propheticus
Propheticus
Member

Aaargh this morning it was https again… I’m lost here, every possible setting has been set to http. Now trying to force https to http via a rewrite rule in the .htaccess file. I don’t get why simple-press is apparently interpreting some variable wordpress is passing as set to https. Every time I check the debugging rules you let me add to sp-control.php they return nothing, while you would expect is_ssl() to return true at that point.

MP Mr Papa
Mr Papa
Member

I am afraid I am at a loss too…  this is unique situation (has not been reported by anyone else) and frankly I am puzzled as to what is going on… 

yes, if those variables are not showing ssl, not even sure how anything is going to it…

so one other thing to try…  go to sp-site-support-functions.php…  at line 239, can you try commenting out that function call to sp_update_permalink(true);

and see if that helps it stick to non ssl for you…

PR Propheticus
Propheticus
Member

Either my or your last fix seems to have helped. Haven’t seen it switch to https the last couple of days. Thanks for troubleshooting with me.

YS Yellow Swordfish
Yellow Swordfish
Member

good news but still maybe leaves the underlying problem as this was a core code workaround…