Support Forum

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

PR Propheticus
Propheticus
Member

Hey Mr P and YS,

Some time ago we switched our site to https/ssl with a WP plugin. We disabled this again due to problems with non-trusted/weak certificate for some user and the fact we didn’t want to spend too much on a good one. The plugin was disabled and removed, and as far as I know all settings were reverted.

Problem: simple-press now keeps automatically changing the forum permalink to something with https://www.foo.bar When clicking the ‘update forum permalink’ button on the integration options page however, the link correctly changes to http://www.foo.bar This change doesn’t stick though, and thus I have to keep manually clicking this button now and again.
Whenever the permalink is in the https:// form some buttons on the forum break (like edit post).

I’ve looked through all the WP setting/config files as well as the .htaccess file and can’t find any settings or rewrite rules that would enable/force https. I can’t figure out where SP is getting the idea from it should change the permalink to https… Any ideas what to check or how to fix?

thanks in advance,

Jeroen

23 Answers

New Answer

MP Mr Papa
Mr Papa
Member

we get it from wp via api function call…  so in wp config file, you removed the force ssl and force admin ssl switches?

check forum – components – login and registration and make sure your urls have been updated if you added in https before…

also check forum – integration – page and permalink and see if the permalink listed has https in it…  try resetting if so…

PR Propheticus
Propheticus
Member

Only a force admin ssl switch was present in the config file. We already had this commented out (also tried giving it the value ‘false’ instead which didn’t help). Maybe try adding a force ssl switch with value false?

All URLs in Loging and Registration are correctly http://

Resetting the permalink is what I have been doing over and over all this time, so does not (permanently) fix it.

MP Mr Papa
Mr Papa
Member

a bit confusing then… because we dont determine ssl or not – wp does…   via call to force_ssl_admin() which is wp function…  returns true if ssl is in effect…

PR Propheticus
Propheticus
Member

What I think is interesting is why the automated update of the permalink changes it to https:// while manually invoking an update results in http://… Is there a difference in the method used to update the url?

 (I set both force ssl login and force ssl admin explicitly to false in the wp-config now just to test again if it helps)

MP Mr Papa
Mr Papa
Member

what do you mean by updated vs auto permalink update methods?

PR Propheticus
Propheticus
Member

Well, apparently the permalink is being updated automatically from time to time, but the user can also manually invoke an update through the admin>forum>integration page. The help file of the update permalink button states: “… This is a backup method for updating your permalink. SPF should automatically update itself if your permalink is changed, but this method can be used if that doesn’t seem to be functioning correctly.”

I was wondering why these 2 methods, auto method -vs- manual backup method, result in a different permalink url.  

MP Mr Papa
Mr Papa
Member

the ‘auto’ method I think you are referring is such that if you update the wp permalink (wp – settings – permalink), we auto update the forum permalink… but if you are not updating that, then there is not auto update…

and they do the same thing… pressing the button just forces a call to the same routine that should get run if you update th wp permalink…

when you update the permalink on forum – integration – page and permalink, is it http or https?  the permalink will come from get_permalink() wp function, so if https, need to see why wp thinks so…

if all that is good, we can go to next step to check…

PR Propheticus
Propheticus
Member

Ehm, that is exactly what I’ve been doing to ‘fix’ the permalink. Doing this results in a correct http://. The problem is I have to keep repeating this, because it keeps changing back to https:// on it’s own.

Also, {wp – settings – permalinks} correctly shows http://www.etcetera… This was one of the first things I checked.

MP Mr Papa
Mr Papa
Member

so again, we need to figure out why wp thinks its ssl…  if we should detect a case where we reset our permalink, we use the wp get_permalink() function which ends up getting home_url() to build the permalink…  and it ends up using is_ssl()…  all wp functions…

do you have a link to your site? no caching plugins, right?

can you make a couple quick edits and see if we can get some more info?  in sp-control.php, around line 110 add these:

vshow(‘ssl=’.is_ssl().'<br />’);
vshow(‘https=’.$_SERVER[‘HTTPS’]);

would want that when you think the permalink has been reset to https…

PR Propheticus
Propheticus
Member

It’s the site linked to my profile: http://www.lion-pack.nl

Actually, we are using W3 total cache plugin. Enabled: Page cache (not for logged in members), browser cache expires headers, object cache and CDN (self-hosted).

Had to disable the eTag, pragma and cache-control browser cache headers to get the forum to work (they’re no use anyways and eTags based on hardware id’s don’t work well when using multiple servers like we do with CDN).

I made the change to sp-control.php you requested, the output was being overlapped with the admin bar in the top. Also it broke the wp-admin page (fonts were bigger and some options didn’t work anymore), so I removed it again. The output underneath (checked the page source) was https= ssl=. So nothing was echo’d. I’d expect either true or false… I’ll add the lines again the next time I notice the permalink has changed and see what it outputs then.

MP Mr Papa
Mr Papa
Member

could you have cached ssl pages in the cache that could be triggering strange things?

I also assume you have told w3tc to NOT cache the forum page for ANY of the caching types in use?  since all forum content is dynamically shown on a single wp page, you cannot cache that page…

PR Propheticus
Propheticus
Member

The caches have been purged (multiple times) since. Also, like you said, I’ve set W3TC to never cache the lion-pack.nl/forum page. The CDN does host the files in wp-content/sp-resources/*, but this is no dynamic content.

MP Mr Papa
Mr Papa
Member

okay, cool… but just to make sure, you did it for each cache type?  in w3tc, each cache type has its own admin page/tab and its own exclusion section…

PR Propheticus
Propheticus
Member

I did where I could (page cache and object cache). Also, the problem occurred when I disabled the w3tc cache plugin in my own trouble-shooting as well.