Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2018-09-29 13:42:31

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: http to https in textpattern

jakob: after more info from the internet and the provider … all addresses (tvdiever.nl; www.tvdiever.nl; http://tvdiever.nl; http://www.tvdiever.nl) are redirected to https://www.tvdiever.nl with this in the config.php file (thank you!) >

<?php
define('PROTOCOL', 'https://');
?>

… and with this in the .htaccess file >

# #helpdesk.mijndomein.nl/.. > https://is.gd/3CdnFt 
RewriteBase /
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

# #www.inmotionhosting.com/.. > https://is.gd/8q0QaG
RewriteCond %{HTTP_HOST} ^tvdiever.nl [NC]
RewriteRule ^(.*)$ https://www.tvdiever.nl/$1 [L,R=301,NC]

:))

Last edited by RedFox (2018-09-29 13:48:37)

Offline

#50 2018-10-02 07:50:54

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: http to https in textpattern

jakob wrote #314210:

class B thing comes from Destry as I hadn’t heard that terminology before.

To set the record straight on this…

‘No-WWW’ was a campaign started in March 2003. The site made very few blog posts in its lifetime because it didn’t need to have much. Here’s a grab from 2013, showing all posts up to the last one in December 2012. The site went offline sometime after April 2016.

The earlier posts make the argument about not needing ‘www’ on URLs and provide that set of mod_rewrite rules. Their argument made a lot of sense to me by the time I found it in 2005 or so, notably the parts about usability and indexing redundancy (if you didn’t point one way or the other specifically), and I stuck with it ever since without much thinking about it. I noted over the years a lot of the digerati opted against ‘www’ too, including Textism.

I don’t think it matters on a technological level whether you use one or the other. The important thing is you decide which to use and stick with it.

However, I was just reading this, To www or not www, which talks about passing cookies down to subdomains from the ‘origin’ (a useful term). I don’t really follow what he’s talking about, but I’d like to grasp it better in case it concerns me, as I have tended to favour more use of subdomains over buying different domains as a way to keep overhead costs down. His article argues for using ‘www’, but if you read down into the comments, he later changes his mind and decides to keep no www (Class B).

Ultimately I like no www for being less crufty and easier to read/use; ‘www’ just seems like pointless, redundant, irrelevant, geeknoobspeak. I remember TBL, or whoever it was responsible, once saying he regretted using the // in URLs too, that it was completely unnecessary, but now has become so after the infrastructure changes, or whatever. Boo.

I would have liked https:wion.com

Offline

#51 2018-10-05 19:31:29

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 176
Website

Re: http to https in textpattern

Howdi. Just a clarification here.

Does

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

globally change all of my hardcoded internal links within my website or do I need to change each individually?

I’ve stupidly been putting this off because I have 1200+ pages with many internal hardcoded links on each page. Probably 10k hardcoded links in all . . .

Offline

#52 2018-10-05 19:35:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: http to https in textpattern

detail wrote #314424:

I’ve stupidly been putting this off because I have 1200+ pages with many internal hardcoded links on each page. Probably 10k hardcoded links in all . . .

I think a MySQL search and replace query might do the trick here. Some background reading: stackoverflow.com/questions/42857921/search-replace-http-to-https-in-database

Last edited by gaekwad (2018-10-05 19:35:39)

Offline

#53 2018-10-05 19:39:36

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 176
Website

Re: http to https in textpattern

Thanks for that.

It seemed too easy.

But I do like the idea of the magic wand approach rather than hard work.

Offline

#54 2018-10-05 19:42:01

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: http to https in textpattern

detail wrote #314427:

It seemed too easy.

But I do like the idea of the magic wand approach rather than hard work.

Make a database backup, and give it a spin. Heck, you could even take a backup, make a known-good copy of the backup, open the first backup SQL in a text editor and do a search and replace in that, then re-import it – same effect, but a bit more obvious in an editor.

Offline

#55 2018-10-05 21:25:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: http to https in textpattern

detail wrote #314424:

Does define('PROTOCOL', 'https://');... globally change all of my hardcoded internal links?

Only those generated by Textpattern tags.

gaekwad’s tip(s) work well, though. Relative internal links don’t need any changes, and external links are irrelevant too – that depends on the other sites.


TXP Builders – finely-crafted code, design and txp

Offline

#56 2018-10-06 02:28:43

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: http to https in textpattern

i idid all manually. i edited all forms, pages and sections
But how to redirect folks that type in bicilogic.com without the HTTPS?
those folks get an error.


…. texted postive

Offline

#57 2018-10-06 04:43:17

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

Re: http to https in textpattern

bici wrote #314432:

i idid all manually. i edited all forms, pages and sections
But how to redirect folks that type in bicilogic.com without the HTTPS?

Or even click on the link to your site in this forum:)

Untested but you could make a redirect in your htaccess

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.bicilogic.com/$1 [R,L]

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

Offline

#58 2018-10-06 05:21:13

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: http to https in textpattern

colak wrote #314433:

Or even click on the link to your site in this forum:)

Untested but you could make a redirect in your htaccess

RewriteEngine On...

sadly that did not do the trick. … but i edited my profile link ;)


…. texted postive

Offline

#59 2018-10-06 07:30:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: http to https in textpattern

bici wrote #314435:

sadly that did not do the trick. … but i edited my profile link ;)

Does this work?

# Force ssl
	RewriteCond %{HTTPS} !=on
	RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#60 2018-10-06 17:06:55

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: http to https in textpattern

whtf! If HTTPS is going to be such a damm hassle

this is what firefox reports:

The page isn’t redirecting properly

An error occurred during a connection to bicilogic.com.

This problem can sometimes be caused by disabling or refusing to accept cookies.

i deleted the rule and it works again. IF i enter https://bicilogic.com

anyone typing bicilogic.com gets an error.


…. texted postive

Offline

Board footer

Powered by FluxBB