Page 1 of 1

Moving to SSL, Replace http to https in KB articles

Posted: Thu Apr 05, 2018 11:56 pm
by cwshubby
Hi,

I want to implement full site wide SSL. To do so I will have to change all of my links for images in my HTML code from http:// to https://

Simple to do in all of my HTML code, however, I have to edit each article manually to do this.

Is there a way to do a mass search and replace within the article area to search for "img src="http:" and replace it with "img src=https:"

Is there a quick way to do this using SQL through our hosting providers back end? Have access to myPHPAdmin.

Any advice for an SQL script I can paste into the console to perform this search and replace? (Otherwise I have to do it manually on a ton of articles)

Thank you!

Re: Moving to SSL, Replace http to https in KB articles

Posted: Fri Apr 06, 2018 12:58 am
by mkoch227
This query should work, assuming you used the image function in the article editor:

Code: Select all

UPDATE `hesk_kb_articles` SET `content` = REPLACE(`content`, '<img src="http://', '<img src="https://')
As always, make a backup of your database so you have something to revert to if bad things happen.