Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 138
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
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,510

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: 138
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
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,510

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: 3,488
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: 1,479
Website

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: 7,292
Website

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.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

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

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 1,479
Website

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: 1,677
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]

Offline

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

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 1,479
Website

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