Mautic generates non-https urls for my landing pages

Your software
My Mautic version is: 5.0.4
My PHP version is: 8.1.28
My Database type and version is: 10.11.8-MariaDB-0ubuntu0.24.04.1

Your problem
My problem is:

I established the based URL for my website as https://mysite.com but when I got to a landing page, it’s URL is http://mysite.com:443/landing instead of https://mysite.com/landing and this seems to be preventing forms from being sent…

Any idea how to fix this? Thanks!

Hi @mchojrin,

I tested it on my Mautic instance, and both the landing pages and the Mautic instance itself are using HTTPS. In your Mautic configuration, under System Settings, does the “Site URL” field include HTTPS?

Additionally, within the System Configuration, under “Additional Response Headers,” you can enable Strict Transport Security and see if that resolves the issue for you.

Another option, for example, is in cPanel, where you can force HTTPS. This could also help fix the problem.

I hope this helps!

Best regards,
Ricardo

Hey @ricfreire , thanks for your help.

My site URL field includes https.

About the Strict Transport Security, I had it activated but de-activated it as a test… same result.

I am self-hosting my Mautic on top of Docker.

I would also have guessed it is related to the site URL. Maybe clearing the cache will help? (Mautic and browser)

Ok, so something must have had to do with the cache. I cleared it and now I’m falling into an infinite redirect loop :sob:

Just checked the nginx configuration, removed the http->https redirect, reloaded and the problem continues… something must be wrong inside mautic config… any idea?

Well, it seems I got my solution from this thread, I just had to add $_SERVER['HTTPS'] = 'on' at the beginning of index.php and both problems got solved in one shot :slight_smile:

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.