Mautic | How to Switch to the https:// Protocol (SSL Certificate)

Mautic | How to Switch to the https:// Protocol (SSL Certificate)

Yesterday, I switched my primary website over to the https:// (secure) protocol. This article is not about how to purchase and install an SSL certificate – it’s about what to do with your installation of Mautic when it ceases to work (and it will cease to work properly) after you’ve installed that certificate.

WARNING: You’re going to need a few geek skills to pull this off. If you don’t have a reasonable understanding of how to edit templates and are not confident inside your cPanel – do not, repeat DO NOT fuck with this – get a geek to assist you. Your hosting provider is not going to be enough to help you to pull this off.

This post is aimed at intermediate to advanced Mautic users.

The Symptoms…

First up, we edited the htaccess file and did the normal redirections that you’d do for a website that has a newly installed SSL certificate, setting up the site to always resolve to the https:// protocol. After we’d done that, we noticed that all of the embedded Mautic forms what we had on our (Joomla!) website had completely disappeared from the pages where they were installed. Clearly, something was wrong.

You’ll also notice that the word SECURE and the padlock which sits beside it on https:// enabled websites may not appear on some pages. Instead, you’ll see a circular icon. If you click this it will alert you that problems exist with the page and it may not be secure. Usually, that will relate to something that has inadvertently been hardcoded on the page, such as an image file. In the case of Mautic, look first at your embedded forms as the source of the problem. I’ll cover how to diagnose and fix this later.

Edit Mautic Configuration

First up, you’ll need to clear your Mautic cache. Mautic does a terrible job of this and you’ll find it easier to simply delete the cache folder, which you’ll find located in the app folder of your installation of Mautic. Don’t worry about deleting the folder. Mautic will generate a new one.

Next, login into your instance of Mautic. Click on the gear icon (top right of admin panel) and navigate to Configuration. In the system settings, you’ll see your website URL. It will be the old http:// URL – not the new https:// URL that you have with you newly installed SSL certificate. Edit the website URL to include the https:// protocol and click save.

When you click save Mautic will resolve to the User/Authentication Settings tab and will display and error warning in red. You need to add the same Email, First name and Last name as you already have entered in your user settings. Click save.

Edit Website Plugins

Chances are you are using a plugin to monitor website visitation if you are using a popular CMS like WordPress or Joomla!. You will need to edit the plugin so that it recognises the new https:// protocol. Navigate to the plugin within your CMS and edit the URL, as required. Click save.

Edit Custom Themes

This next step only applies if you have custom themes installed. Even then it may not apply if relative URL’s have been consistently used in creating those themes. Especially if your custom themes are older, there is a big chance that they may contain hardcoded URL’s. Older versions of Mautic (back in the 1’s) sometimes rejected relative URL’s when creating templates. A quick look at the public pages of your template should tell you if anything requires attention.

Go to your cPanel (or use ftp) and navigate to your installation of Mautic, then navigate to the theme that you wish to edit. You’ll then need to go through html / html.twig files and edit any hardcoded URL’s to reflect the new https:// protocol. Notably, pages and forms appear to be affected. I went through everything – and even cleaned up some messy code!

After I’d done all of that, everything seemed to work fine – except for one thing…

Edit Forms

Earlier I mentioned the problem of pages still being insecure. It only affected pages with embedded Mautic forms on them. The solution is simple. Mautic forms all provide a for a return URL (the URL visitors are directed to upon submission of a form). Navigate to each form and edit the Redirect/URL Message field to include the https:// protocol. That immediately cleared up my issue, with some pages displaying as insecure.

Warning

This was my first run through on this. I fully expect to uncover more issues in the next day or two. I’ll update this post as I identify and resolve those problems.

Tony Gavin

Erstwhile accountant, serial entrepreneur, web developer, digital marketing veteran and lover of all things marketing automation and artificial intelligence. Tony hates almost everyone except for pathetic nerd boys and geek gals just like him, but loves his computer, and enjoys ranting incoherently into cyberspace. He also loves dark German beers, his four poodles Weasley, Khaleesi, Rebel and Lumpy - and his infinitely patient lady love, Mitzi. When he's not flitting between his home in Manila, Philippines and his family and clients in Australia and elsewhere, Tony occasionally takes the time to do some actual work, and comes up with totally intelligent marketing ideas that www.work! You should contact Tony if your marketing sucks, or even if it doesn't. Chances are he'll want to make it better. Just because he can.

Click Here to Leave a Comment Below

Aguitta - 28/02/2019

Hey Gavin! Maybe you can help me. 🙂 A link in the right direction would suffice. I´m having issues with the ssl certificate. In essense, the message on the Opera Browser is saying: “Your Conection to this site is not fully secure” when on the admin panel. When clicking on the ssl certificate icon, I get the following:

Your connection to this site is not fully secure. Attakers might be able to see the images you´re looking at on this site adn trick you by modifying them. Bellow it reads: Certificate (Valid). Along with information on cookies being used. How can I get this to give me the soothing little green lock that says secure conection? Please help.

Reply
    Tony Gavin - 23/07/2019

    That could be so many things. You might want to run the relevant pages where you are getting this message through https://www.whynopadlock.com/. I’ve never had an SSL problem I couldn’t sort out after using this tool. If it’s something too technical for you, you can always link the result to your web host and ask for their assistance in sorting out the problem – especially if you are using one of their server-level SSL’s rather than you own. Sorry for the late response on this. Good luck!

    Reply
Glen - 12/03/2019

Have you ever before had issues with your webhost?
I’m open for suggestions as my webhost is dreadful right now.

Reply
    Tony Gavin - 23/07/2019

    I’ve had a LOT of issues with hosts. Right now I’m using A2 Hosting. Their support isn’t great, but they do offer a stable server environment that Mautic seems to like. You might want to give them a go.

    Reply
RapCore - 15/09/2019

Hey there would you mind letting me know which webhost you’re utilizing?

I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a
lot quicker then most. Can you recommend a good web hosting provider at a fair price? Thanks, I appreciate it!

Reply
Leave a Reply: