Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-04-08 08:07:07

MelMaster
New Member
Registered: 2018-04-08
Posts: 2

Textpattern loads css.php over HTTP, not HTTPS; mixed content error

Hello,

I’m new to Textpattern, and I certainly prefer it to other CMS’s, because it allows me to do so much handcoding, and I think it’s a perfect balance between coding everything from scratch, including content itself, and using a typical WP installation with a lot of hooks I won’t ever have a need for.

That said, I’ve experienced a problem with it from the get go. A fresh installation of Textpattern loads the standard CSS file over HTTP rather than HTTPS, which causes a mixed content error from the very beginning, which, in its turns, leads to the CSS being blocked.

I was able to remedy this problem temporarily by using Cloudflare’s “Automatic HTTPS Rewrites” (it forcibly overwrites http to https everywhere in the html it proxies), but it’s not a solution I want to rely on. How do I make <txp:css /> and <txp:site_url /> use the HTTPS scheme?

Of course, I can just edit the forms and pages, but if there is a more elegant solution, I’d rather use it. If I can’t fix <txp:site_url />, then I can’t use it anywhere. And I’d rather fix it and use it.

Thanks.

UPD: I’m using Textpattern 4.6.2

Last edited by MelMaster (2018-04-08 08:11:23)

Offline

#2 2018-04-08 08:24:28

MelMaster
New Member
Registered: 2018-04-08
Posts: 2

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

I found the answer to my own question. I just needed to add

define('PROTOCOL', 'https://');

to my config.php.

Strange how I always seem to find solutions after I ask someone to help me with the problem…

Last edited by MelMaster (2018-04-08 08:25:56)

Offline

#3 2018-04-08 08:56:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,819
Website GitHub

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

MelMaster wrote #310759:

I’m new to Textpattern, and I certainly prefer it to other CMS’s, because it allows me to do so much handcoding, and I think it’s a perfect balance between coding everything from scratch, including content itself, and using a typical WP installation with a lot of hooks I won’t ever have a need for.

Welcome, and thank you for your positive thoughts of the CMS. We work hard to try to balance the “kitchen sink” approach with a minimalism and extensibility to allow you to Just write. We hope that making your designs and content available is simple and enjoyable.

We’re always trying to enhance Textpattern while staying true to its minimalist spirit, so if you have any improvement ideas as you become more familiar with it, we’ll duly consider them. v4.7.0 should be out within the next few weeks.

Strange how I always seem to find solutions after I ask someone to help me with the problem…

You and me both! I keep a rubber duck handy when coding :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2018-04-08 09:50:33

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

If you use CSS as flat files instead of loading into database (which I’d recommend), you can ignore css.php as it is not needed.

Offline

#5 2018-04-08 10:31:51

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,548
Website GitHub Twitter

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

Hi,

@phil : For me the theme css is flat file but i allway add bdd css for tweekings after delivery, it s fastest for me to do that.

Cheers

Offline

#6 2018-04-08 10:36:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,193
Website GitHub Mastodon Twitter

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

rvm_css and spf_js satisfy my needs to both have the files in the db and serve them as flat files on the client side. With the theme support on 4.7 and the possibility of flat templates, I would so much like both of the plugins to be part of the core!


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2018-04-11 14:36:28

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

colak wrote #310768:

rvm_css and spf_js satisfy my needs to both have the files in the db and serve them as flat files on the client side. With the theme support on 4.7 and the possibility of flat templates, I would so much like both of the plugins to be part of the core!

Yiannis, why wouldn’t you link your CSS directly to

<txp:page_url type="theme_path" />/styles/my_style.css

Then every time you edit my_style (either way), just sync the db and the fs versions.

Offline

#8 2018-04-11 17:13:07

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,193
Website GitHub Mastodon Twitter

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

etc wrote #310883:

Yiannis, why wouldn’t you link your CSS directly to

<txp:page_url type="theme_path" />/styles/my_style.css...

Then every time you edit my_style (either way), just sync the db and the fs versions.

Hi Oleg
I guess that this is for 4.7! I have it installed for debugging but not on the live site yet. I am testing it so as to get ready for a smooth transition. Admittedly, I am yet to experiment with themes but from what you are saying the css is now been saved in the themes folder?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2018-04-11 18:38:05

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: Textpattern loads css.php over HTTP, not HTTPS; mixed content error

colak wrote #310891:

I guess that this is for 4.7

Yes, how could it be part of the core otherwise? :-) AFAIK we have no 4.6.3 plans, and I’m running 4.7-dev since many months on my plugins site without any problem.

Offline

Board footer

Powered by FluxBB