Moving to SSL, Replace http to https in KB articles

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
cwshubby
Posts: 27
Joined: Thu Jul 17, 2014 3:36 am

Moving to SSL, Replace http to https in KB articles

Post 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!
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

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

Post 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.
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
Post Reply